this.gateway.on('quit', onQuit, this);
this.gateway.on('kick', onKick, this);
this.gateway.on('msg', onMsg, this);
+ this.gateway.on('nick', onNick, this);
this.gateway.on('ctcp_request', onCtcpRequest, this);
this.gateway.on('ctcp_response', onCtcpResponse, this);
this.gateway.on('notice', onNotice, this);
+ function onNick(event) {
+ var member;
+
+ $.each(this.panels.models, function (index, panel) {
+ if (panel.get('name') == event.nick)
+ panel.set('name', event.newnick);
+
+ if (!panel.isChannel()) return;
+
+ member = panel.get('members').getByNick(event.nick);
+ if (member) {
+ member.set('nick', event.newnick);
+ panel.addMsg('', '== ' + event.nick + ' is now known as ' + event.newnick, 'action nick');
+ }
+ });
+ }
+
+
+
function onCtcpRequest(event) {
// An ignored user? don't do anything with it
if (_kiwi.gateway.isNickIgnored(event.nick)) {
panel.tab.appendTo(this.$el);\r
\r
panel.bind('change:title', this.updateTabTitle);\r
+ panel.bind('change:name', this.updateTabTitle);\r
+\r
_kiwi.app.view.doLayout();\r
},\r
panelRemoved: function (panel) {\r