3 _kiwi
.model
.Network
= Backbone
.Model
.extend({
7 * The name of the network
13 * The address (URL) of the network
19 * The port for the network
25 * If this network uses SSL
31 * The password to connect to this network
37 * The current nickname
43 * The channel prefix for this network
49 * The user prefixes for channel owner/admin/op/voice etc. on this network
52 user_prefixes
: ['~', '&', '@', '+'],
55 * List of nicks we are ignoring
62 initialize: function () {
63 // If we already have a connection, bind our events
64 if (typeof this.get('connection_id') !== 'undefined') {
65 this.gateway
= _kiwi
.global
.components
.Network(this.get('connection_id'));
66 this.bindGatewayEvents();
69 // Create our panel list (tabs)
70 this.panels
= new _kiwi
.model
.PanelList([], this);
71 //this.panels.network = this;
73 // Automatically create a server tab
74 var server_panel
= new _kiwi
.model
.Server({name
: 'Server'});
75 this.panels
.add(server_panel
);
76 this.panels
.server
= this.panels
.active
= server_panel
;
80 reconnect: function(callback_fn
) {
83 nick
: this.get('nick'),
84 host
: this.get('address'),
85 port
: this.get('port'),
87 password
: this.get('password')
90 _kiwi
.gateway
.makeIrcConnection(server_info
, function(err
, connection_id
) {
92 that
.gateway
.dispose();
94 that
.set('connection_id', connection_id
);
95 that
.gateway
= _kiwi
.global
.components
.Network(that
.get('connection_id'));
96 that
.bindGatewayEvents();
98 callback_fn
&& callback_fn(err
);
101 console
.log("_kiwi.gateway.socket.on('error')", {reason
: err
});
102 callback_fn
&& callback_fn(err
);
108 bindGatewayEvents: function () {
109 //this.gateway.on('all', function() {console.log('ALL', this.get('connection_id'), arguments);});
111 this.gateway
.on('connect', onConnect
, this);
112 this.gateway
.on('disconnect', onDisconnect
, this);
114 this.gateway
.on('nick', function(event
) {
115 if (event
.nick
=== this.get('nick')) {
116 this.set('nick', event
.newnick
);
120 this.gateway
.on('options', onOptions
, this);
121 this.gateway
.on('motd', onMotd
, this);
122 this.gateway
.on('join', onJoin
, this);
123 this.gateway
.on('part', onPart
, this);
124 this.gateway
.on('quit', onQuit
, this);
125 this.gateway
.on('kick', onKick
, this);
126 this.gateway
.on('msg', onMsg
, this);
127 this.gateway
.on('nick', onNick
, this);
128 this.gateway
.on('ctcp_request', onCtcpRequest
, this);
129 this.gateway
.on('ctcp_response', onCtcpResponse
, this);
130 this.gateway
.on('notice', onNotice
, this);
131 this.gateway
.on('action', onAction
, this);
132 this.gateway
.on('topic', onTopic
, this);
133 this.gateway
.on('topicsetby', onTopicSetBy
, this);
134 this.gateway
.on('userlist', onUserlist
, this);
135 this.gateway
.on('userlist_end', onUserlistEnd
, this);
136 this.gateway
.on('banlist', onBanlist
, this);
137 this.gateway
.on('mode', onMode
, this);
138 this.gateway
.on('whois', onWhois
, this);
139 this.gateway
.on('whowas', onWhowas
, this);
140 this.gateway
.on('away', onAway
, this);
141 this.gateway
.on('list_start', onListStart
, this);
142 this.gateway
.on('irc_error', onIrcError
, this);
143 this.gateway
.on('unknown_command', onUnknownCommand
, this);
144 this.gateway
.on('channel_info', onChannelInfo
, this);
149 * Create panels and join the channel
150 * This will not wait for the join event to create a panel. This
151 * increases responsiveness in case of network lag
153 createAndJoinChannels: function (channels
) {
157 // Multiple channels may come as comma-delimited
158 if (typeof channels
=== 'string') {
159 channels
= channels
.split(',');
162 $.each(channels
, function (index
, channel_name_key
) {
163 // We may have a channel key so split it off
164 var spli
= channel_name_key
.trim().split(' '),
165 channel_name
= spli
[0],
166 channel_key
= spli
[1] || '';
168 // Trim any whitespace off the name
169 channel_name
= channel_name
.trim();
171 // Add channel_prefix in front of the first channel if missing
172 if (that
.get('channel_prefix').indexOf(channel_name
[0]) === -1) {
173 // Could be many prefixes but '#' is highly likely the required one
174 channel_name
= '#' + channel_name
;
177 // Check if we have the panel already. If not, create it
178 channel
= that
.panels
.getByName(channel_name
);
180 channel
= new _kiwi
.model
.Channel({name
: channel_name
, network
: that
});
181 that
.panels
.add(channel
);
184 panels
.push(channel
);
186 that
.gateway
.join(channel_name
, channel_key
);
195 * Join all the open channels we have open
196 * Reconnecting to a network would typically call this.
198 rejoinAllChannels: function() {
201 this.panels
.forEach(function(panel
) {
202 if (!panel
.isChannel())
205 that
.gateway
.join(panel
.get('name'));
209 isChannelName: function (channel_name
) {
210 var channel_prefix
= this.get('channel_prefix');
212 if (!channel_name
|| !channel_name
.length
) return false;
213 return (channel_prefix
.indexOf(channel_name
[0]) > -1);
216 // Check a nick alongside our ignore list
217 isNickIgnored: function (nick
) {
218 var idx
, list
= this.get('ignore_list');
221 for (idx
= 0; idx
< list
.length
; idx
++) {
222 pattern
= list
[idx
].replace(/([.+^$[\]\\(){}|-])/g, "\\$1")
226 regex
= new RegExp(pattern
, 'i');
227 if (regex
.test(nick
)) return true;
236 function onDisconnect(event
) {
237 $.each(this.panels
.models
, function (index
, panel
) {
238 panel
.addMsg('', styleText('client_models_network_disconnected', {'%T': translateText('client_models_network_disconnected', [])}), 'action quit');
244 function onConnect(event
) {
245 var panels
, channel_names
;
247 // Update our nick with what the network gave us
248 this.set('nick', event
.nick
);
250 // If this is a re-connection then we may have some channels to re-join
251 this.rejoinAllChannels();
253 // Auto joining channels
254 if (this.auto_join
&& this.auto_join
.channel
) {
255 panels
= this.createAndJoinChannels(this.auto_join
.channel
+ ' ' + (this.auto_join
.key
|| ''));
257 // Show the last channel if we have one
259 panels
[panels
.length
- 1].view
.show();
261 delete this.auto_join
;
267 function onOptions(event
) {
270 $.each(event
.options
, function (name
, value
) {
273 that
.set('channel_prefix', value
.join(''));
276 that
.set('name', value
);
279 that
.set('user_prefixes', value
);
284 this.set('cap', event
.cap
);
289 function onMotd(event
) {
290 this.panels
.server
.addMsg(this.get('name'), styleText('motd', {'%T': event
.msg
}), 'motd');
295 function onJoin(event
) {
296 var c
, members
, user
;
297 c
= this.panels
.getByName(event
.channel
);
299 c
= new _kiwi
.model
.Channel({name
: event
.channel
, network
: this});
303 members
= c
.get('members');
304 if (!members
) return;
306 user
= new _kiwi
.model
.Member({nick
: event
.nick
, ident
: event
.ident
, hostname
: event
.hostname
});
307 members
.add(user
, {kiwi
: event
});
312 function onPart(event
) {
313 var channel
, members
, user
,
316 part_options
.type
= 'part';
317 part_options
.message
= event
.message
|| '';
318 part_options
.time
= event
.time
;
320 channel
= this.panels
.getByName(event
.channel
);
321 if (!channel
) return;
323 // If this is us, close the panel
324 if (event
.nick
=== this.get('nick')) {
329 members
= channel
.get('members');
330 if (!members
) return;
332 user
= members
.getByNick(event
.nick
);
335 members
.remove(user
, {kiwi
: part_options
});
340 function onQuit(event
) {
344 quit_options
.type
= 'quit';
345 quit_options
.message
= event
.message
|| '';
346 quit_options
.time
= event
.time
;
348 $.each(this.panels
.models
, function (index
, panel
) {
349 if (!panel
.isChannel()) return;
351 member
= panel
.get('members').getByNick(event
.nick
);
353 panel
.get('members').remove(member
, {kiwi
: quit_options
});
360 function onKick(event
) {
361 var channel
, members
, user
,
364 part_options
.type
= 'kick';
365 part_options
.by
= event
.nick
;
366 part_options
.message
= event
.message
|| '';
367 part_options
.current_user_kicked
= (event
.kicked
== this.get('nick'));
368 part_options
.current_user_initiated
= (event
.nick
== this.get('nick'));
369 part_options
.time
= event
.time
;
371 channel
= this.panels
.getByName(event
.channel
);
372 if (!channel
) return;
374 members
= channel
.get('members');
375 if (!members
) return;
377 user
= members
.getByNick(event
.kicked
);
381 members
.remove(user
, {kiwi
: part_options
});
383 if (part_options
.current_user_kicked
) {
390 function onMsg(event
) {
392 is_pm
= (event
.channel
.toLowerCase() == this.get('nick').toLowerCase());
394 // An ignored user? don't do anything with it
395 if (this.isNickIgnored(event
.nick
)) {
400 // If a panel isn't found for this PM, create one
401 panel
= this.panels
.getByName(event
.nick
);
403 panel
= new _kiwi
.model
.Query({name
: event
.nick
});
404 this.panels
.add(panel
);
408 // If a panel isn't found for this channel, reroute to the
410 panel
= this.panels
.getByName(event
.channel
);
412 panel
= this.panels
.server
;
416 panel
.addMsg(event
.nick
, styleText('privmsg', {'%T': event
.msg
}), 'privmsg', {time
: event
.time
});
421 function onNick(event
) {
424 $.each(this.panels
.models
, function (index
, panel
) {
425 if (panel
.get('name') == event
.nick
)
426 panel
.set('name', event
.newnick
);
428 if (!panel
.isChannel()) return;
430 member
= panel
.get('members').getByNick(event
.nick
);
432 member
.set('nick', event
.newnick
);
433 panel
.addMsg('', styleText('client_models_network_nickname_changed', {'%N': event
.nick
, '%T': translateText('client_models_network_nickname_changed', [event
.newnick
]), '%C': name
}), 'action nick', {time
: event
.time
});
440 function onCtcpRequest(event
) {
441 // An ignored user? don't do anything with it
442 if (this.isNickIgnored(event
.nick
)) {
446 // Reply to a TIME ctcp
447 if (event
.msg
.toUpperCase() === 'TIME') {
448 this.gateway
.ctcp(false, event
.type
, event
.nick
, (new Date()).toString());
454 function onCtcpResponse(event
) {
455 // An ignored user? don't do anything with it
456 if (this.isNickIgnored(event
.nick
)) {
460 this.panels
.server
.addMsg('[' + event
.nick
+ ']', styleText('ctcp', {'%T': event
.msg
}), 'ctcp', {time
: event
.time
});
465 function onNotice(event
) {
466 var panel
, active_panel
, channel_name
;
468 // An ignored user? don't do anything with it
469 if (!event
.from_server
&& event
.nick
&& this.isNickIgnored(event
.nick
)) {
473 // Find a panel for the destination(channel) or who its from
474 if (!event
.from_server
) {
475 panel
= this.panels
.getByName(event
.target
) || this.panels
.getByName(event
.nick
);
477 // Forward ChanServ messages to its associated channel
478 if (event
.nick
&& event
.nick
.toLowerCase() == 'chanserv' && event
.msg
.charAt(0) == '[') {
479 channel_name
= /\[([^ \]]+)\]/gi.exec(event
.msg
);
480 if (channel_name
&& channel_name
[1]) {
481 channel_name
= channel_name
[1];
483 panel
= this.panels
.getByName(channel_name
);
488 panel
= this.panels
.server
;
491 panel
= this.panels
.server
;
494 panel
.addMsg('[' + (event
.nick
||'') + ']', styleText('notice', {'%T': event
.msg
}), 'notice', {time
: event
.time
});
496 // Show this notice to the active panel if it didn't have a set target, but only in an active channel or query window
497 active_panel
= _kiwi
.app
.panels().active
;
499 if (!event
.from_server
&& panel
=== this.panels
.server
&& active_panel
!== this.panels
.server
) {
500 if (active_panel
.isChannel() || active_panel
.isQuery())
501 _kiwi
.app
.panels().active
.addMsg('[' + (event
.nick
||'') + ']', styleText('notice', {'%T': event
.msg
}), 'notice', {time
: event
.time
});
507 function onAction(event
) {
509 is_pm
= (event
.channel
.toLowerCase() == this.get('nick').toLowerCase());
511 // An ignored user? don't do anything with it
512 if (this.isNickIgnored(event
.nick
)) {
517 // If a panel isn't found for this PM, create one
518 panel
= this.panels
.getByName(event
.nick
);
520 panel
= new _kiwi
.model
.Channel({name
: event
.nick
, network
: this});
521 this.panels
.add(panel
);
525 // If a panel isn't found for this channel, reroute to the
527 panel
= this.panels
.getByName(event
.channel
);
529 panel
= this.panels
.server
;
533 panel
.addMsg('', styleText('action', {'%N': event
.nick
, '%T': event
.msg
}), 'action', {time
: event
.time
});
538 function onTopic(event
) {
540 c
= this.panels
.getByName(event
.channel
);
543 // Set the channels topic
544 c
.set('topic', event
.topic
);
546 // If this is the active channel, update the topic bar too
547 if (c
.get('name') === this.panels
.active
.get('name')) {
548 _kiwi
.app
.topicbar
.setCurrentTopic(event
.topic
);
554 function onTopicSetBy(event
) {
556 c
= this.panels
.getByName(event
.channel
);
559 when
= formatDate(new Date(event
.when
* 1000));
560 c
.addMsg('', styleText('client_models_network_topic', {'%T': translateText('client_models_network_topic', [event
.nick
, when
]), '%C': event
.channel
}), 'topic');
565 function onChannelInfo(event
) {
566 var channel
= this.panels
.getByName(event
.channel
);
567 if (!channel
) return;
570 channel
.set('info_url', event
.url
);
571 } else if (event
.modes
) {
572 channel
.set('info_modes', event
.modes
);
578 function onUserlist(event
) {
580 channel
= this.panels
.getByName(event
.channel
);
582 // If we didn't find a channel for this, may aswell leave
583 if (!channel
) return;
585 channel
.temp_userlist
= channel
.temp_userlist
|| [];
586 _
.each(event
.users
, function (item
) {
587 var user
= new _kiwi
.model
.Member({nick
: item
.nick
, modes
: item
.modes
});
588 channel
.temp_userlist
.push(user
);
594 function onUserlistEnd(event
) {
596 channel
= this.panels
.getByName(event
.channel
);
598 // If we didn't find a channel for this, may aswell leave
599 if (!channel
) return;
601 // Update the members list with the new list
602 channel
.get('members').reset(channel
.temp_userlist
|| []);
604 // Clear the temporary userlist
605 delete channel
.temp_userlist
;
610 function onBanlist(event
) {
611 var channel
= this.panels
.getByName(event
.channel
);
615 channel
.set('banlist', event
.bans
|| []);
620 function onMode(event
) {
621 var channel
, i
, prefixes
, members
, member
, find_prefix
,
622 request_updated_banlist
= false;
624 // Build a nicely formatted string to be displayed to a regular human
625 function friendlyModeString (event_modes
, alt_target
) {
626 var modes
= {}, return_string
;
628 // If no default given, use the main event info
630 event_modes
= event
.modes
;
631 alt_target
= event
.target
;
634 // Reformat the mode object to make it easier to work with
635 _
.each(event_modes
, function (mode
){
636 var param
= mode
.param
|| alt_target
|| '';
638 // Make sure we have some modes for this param
640 modes
[param
] = {'+':'', '-':''};
643 modes
[param
][mode
.mode
[0]] += mode
.mode
.substr(1);
646 // Put the string together from each mode
648 _
.each(modes
, function (modeset
, param
) {
650 if (modeset
['+']) str
+= '+' + modeset
['+'];
651 if (modeset
['-']) str
+= '-' + modeset
['-'];
652 return_string
.push(str
+ ' ' + param
);
654 return_string
= return_string
.join(', ');
656 return return_string
;
660 channel
= this.panels
.getByName(event
.target
);
662 prefixes
= this.get('user_prefixes');
663 find_prefix = function (p
) {
664 return event
.modes
[i
].mode
[1] === p
.mode
;
666 for (i
= 0; i
< event
.modes
.length
; i
++) {
667 if (_
.any(prefixes
, find_prefix
)) {
669 members
= channel
.get('members');
671 member
= members
.getByNick(event
.modes
[i
].param
);
673 console
.log('MODE command recieved for unknown member %s on channel %s', event
.modes
[i
].param
, event
.target
);
676 if (event
.modes
[i
].mode
[0] === '+') {
677 member
.addMode(event
.modes
[i
].mode
[1]);
678 } else if (event
.modes
[i
].mode
[0] === '-') {
679 member
.removeMode(event
.modes
[i
].mode
[1]);
684 // Channel mode being set
685 // TODO: Store this somewhere?
686 //channel.addMsg('', 'CHANNEL === ' + event.nick + ' set mode ' + event.modes[i].mode + ' on ' + event.target, 'action mode');
689 // TODO: Be smart, remove this specific ban from the banlist rather than request a whole banlist
690 if (event
.modes
[i
].mode
[1] == 'b')
691 request_updated_banlist
= true;
694 channel
.addMsg('', styleText('client_models_network_mode', {'%N': event
.nick
, '%T': translateText('client_models_network_mode', [friendlyModeString()]), '%C': event
.target
}), 'action mode', {time
: event
.time
});
696 // TODO: Be smart, remove the specific ban from the banlist rather than request a whole banlist
697 if (request_updated_banlist
)
698 this.gateway
.raw('MODE ' + channel
.get('name') + ' +b');
701 // This is probably a mode being set on us.
702 if (event
.target
.toLowerCase() === this.get("nick").toLowerCase()) {
703 this.panels
.server
.addMsg('', styleText('client_models_network_selfmode', {'%N': event
.nick
, '%T': translateText('client_models_network_mode', [friendlyModeString()]), '%C': event
.target
}), 'action mode');
705 console
.log('MODE command recieved for unknown target %s: ', event
.target
, event
);
712 function onWhois(event
) {
713 var logon_date
, idle_time
= '', panel
;
718 if (typeof event
.idle
!== 'undefined') {
719 idle_time
= secondsToTime(parseInt(event
.idle
, 10));
720 idle_time
= idle_time
.h
.toString().lpad(2, "0") + ':' + idle_time
.m
.toString().lpad(2, "0") + ':' + idle_time
.s
.toString().lpad(2, "0");
723 panel
= _kiwi
.app
.panels().active
;
725 panel
.addMsg(event
.nick
, styleText('whois_ident', {'%N': event
.nick
, '%J': event
.ident
, '%H': event
.host
, '%T': event
.msg
}), 'whois');
727 } else if (event
.chans
) {
728 panel
.addMsg(event
.nick
, styleText('client_models_network_channels', {'%N': event
.nick
, '%T': translateText('client_models_network_channels', [event
.chans
])}), 'whois');
729 } else if (event
.irc_server
) {
730 panel
.addMsg(event
.nick
, styleText('client_models_network_server', {'%N': event
.nick
, '%T': translateText('client_models_network_server', [event
.irc_server
, event
.server_info
])}), 'whois');
731 } else if (event
.msg
) {
732 panel
.addMsg(event
.nick
, styleText('whois', {'%T': event
.msg
}), 'whois');
733 } else if (event
.logon
) {
734 logon_date
= new Date();
735 logon_date
.setTime(event
.logon
* 1000);
736 logon_date
= formatDate(logon_date
);
738 panel
.addMsg(event
.nick
, styleText('client_models_network_idle_and_signon', {'%N': event
.nick
, '%T': translateText('client_models_network_idle_and_signon', [idle_time
, logon_date
])}), 'whois');
739 } else if (event
.away_reason
) {
740 panel
.addMsg(event
.nick
, styleText('client_models_network_away', {'%N': event
.nick
, '%T': translateText('client_models_network_away', [event
.away_reason
])}), 'whois');
742 panel
.addMsg(event
.nick
, styleText('client_models_network_idle', {'%N': event
.nick
, '%T': translateText('client_models_network_idle', [idle_time
])}), 'whois');
746 function onWhowas(event
) {
752 panel
= _kiwi
.app
.panels().active
;
754 panel
.addMsg(event
.nick
, styleText('who', {'%N': event
.nick
, '%J': event
.ident
, '%H': event
.host
, '%R': event
.real_name
, '%T': event
.msg
}), 'whois');
756 panel
.addMsg(event
.nick
, styleText('client_models_network_nickname_notfound', {'%N': event
.nick
, '%T': translateText('client_models_network_nickname_notfound', [])}), 'whois');
761 function onAway(event
) {
762 $.each(this.panels
.models
, function (index
, panel
) {
763 if (!panel
.isChannel()) return;
765 member
= panel
.get('members').getByNick(event
.nick
);
767 member
.set('away', !(!event
.reason
));
774 function onListStart(event
) {
775 var chanlist
= _kiwi
.model
.Applet
.loadOnce('kiwi_chanlist');
776 chanlist
.view
.show();
781 function onIrcError(event
) {
784 if (event
.channel
!== undefined && !(panel
= this.panels
.getByName(event
.channel
))) {
785 panel
= this.panels
.server
;
788 switch (event
.error
) {
789 case 'banned_from_channel':
790 panel
.addMsg(' ', styleText('client_models_network_banned', {'%N': event
.nick
, '%T': translateText('client_models_network_banned', [event
.channel
, event
.reason
]), '%C': event
.channel
}), 'status');
791 _kiwi
.app
.message
.text(_kiwi
.global
.i18n
.translate('client_models_network_banned').fetch(event
.channel
, event
.reason
));
793 case 'bad_channel_key':
794 panel
.addMsg(' ', styleText('client_models_network_channel_badkey', {'%N': event
.nick
, '%T': translateText('client_models_network_channel_badkey', [event
.channel
]), '%C': event
.channel
}), 'status');
795 _kiwi
.app
.message
.text(_kiwi
.global
.i18n
.translate('client_models_network_channel_badkey').fetch(event
.channel
));
797 case 'invite_only_channel':
798 panel
.addMsg(' ', styleText('client_models_network_channel_inviteonly', {'%N': event
.nick
, '%T': translateText('client_models_network_channel_inviteonly', [event
.nick
, event
.channel
]), '%C': event
.channel
}), 'status');
799 _kiwi
.app
.message
.text(event
.channel
+ ' ' + _kiwi
.global
.i18n
.translate('client_models_network_channel_inviteonly').fetch());
801 case 'user_on_channel':
802 panel
.addMsg(' ', styleText('client_models_network_channel_alreadyin', {'%N': event
.nick
, '%T': translateText('client_models_network_channel_alreadyin'), '%C': event
.channel
}));
804 case 'channel_is_full':
805 panel
.addMsg(' ', styleText('client_models_network_channel_limitreached', {'%N': event
.nick
, '%T': translateText('client_models_network_channel_limitreached', [event
.channel
]), '%C': event
.channel
}), 'status');
806 _kiwi
.app
.message
.text(event
.channel
+ ' ' + _kiwi
.global
.i18n
.translate('client_models_network_channel_limitreached').fetch(event
.channel
));
808 case 'chanop_privs_needed':
809 panel
.addMsg(' ', styleText('chanop_privs_needed', {'%T': event
.reason
, '%C': event
.channel
}), 'status');
810 _kiwi
.app
.message
.text(event
.reason
+ ' (' + event
.channel
+ ')');
813 tmp
= this.panels
.getByName(event
.nick
);
815 tmp
.addMsg(' ', styleText('no_such_nick', {'%N': event
.nick
, '%T': event
.reason
, '%C': event
.channel
}), 'status');
817 this.panels
.server
.addMsg(' ', styleText('no_such_nick', {'%N': event
.nick
, '%T': event
.reason
, '%C': event
.channel
}), 'status');
820 case 'nickname_in_use':
821 this.panels
.server
.addMsg(' ', styleText('client_models_network_nickname_alreadyinuse', {'%N': event
.nick
, '%T': translateText('client_models_network_nickname_alreadyinuse', [event
.nick
]), '%C': event
.channel
}), 'status');
822 if (this.panels
.server
!== this.panels
.active
) {
823 _kiwi
.app
.message
.text(_kiwi
.global
.i18n
.translate('client_models_network_nickname_alreadyinuse').fetch(event
.nick
));
826 // Only show the nickchange component if the controlbox is open
827 if (_kiwi
.app
.controlbox
.$el
.css('display') !== 'none') {
828 (new _kiwi
.view
.NickChangeBox()).render();
833 case 'password_mismatch':
834 this.panels
.server
.addMsg(' ', styleText('client_models_network_badpassword', {'%N': event
.nick
, '%T': translateText('client_models_network_badpassword', []), '%C': event
.channel
}), 'status');
837 // We don't know what data contains, so don't do anything with it.
838 //_kiwi.front.tabviews.server.addMsg(null, ' ', '== ' + data, 'status');
843 function onUnknownCommand(event
) {
844 var display_params
= _
.clone(event
.params
);
846 // A lot of commands have our nick as the first parameter. This is redundant for us
847 if (display_params
[0] && display_params
[0] == this.get('nick')) {
848 display_params
.shift();
851 this.panels
.server
.addMsg('', styleText('unknown_command', {'%T': '[' + event
.command
+ '] ' + display_params
.join(', ', '')}));