} else if (event.mode[0] === '-') {\r
member.removeMode(event.mode.substr(1));\r
}\r
+ });\r
+\r
+\r
+ gw.on('onnick', function (event) {\r
+ var member;\r
\r
+ $.each(that.panels.models, function (index, panel) {\r
+ if (!panel.isChannel()) return;\r
+\r
+ member = panel.get('members').getByNick(event.nick);\r
+ if (member) {\r
+ member.set('nick', event.newnick);\r
+ panel.addMsg('', '== ' + event.nick + ' is now known as ' + event.newnick, 'action nick');\r
+ }\r
+ });\r
});\r
};\r
\r
break;\r
\r
case 'nick':\r
- that.set('nick', item.newnick);\r
+ if (item.nick === that.get('nick')) {\r
+ that.set('nick', item.newnick);\r
+ }\r
break;\r
/*\r
case 'sync':\r