panel.addMsg(event.nick, 'idle for ' + idle_time, 'whois');\r
}\r
});\r
+\r
+\r
+ gw.on('onirc_error', function (data) {\r
+ var panel, tmp;\r
+\r
+ if (data.channel !== undefined && !(panel = kiwi.app.panels.getByName(data.channel))) {\r
+ panel = kiwi.app.panels.server;\r
+ }\r
+\r
+ switch (data.error) {\r
+ case 'banned_from_channel':\r
+ panel.addMsg(' ', '=== You are banned from ' + data.channel + '. ' + data.reason, 'status');\r
+ kiwi.app.message.text('You are banned from ' + data.channel + '. ' + data.reason);\r
+ break;\r
+ case 'bad_channel_key':\r
+ panel.addMsg(' ', '=== Bad channel key for ' + data.channel, 'status');\r
+ kiwi.app.message.text('Bad channel key or password for ' + data.channel);\r
+ break;\r
+ case 'invite_only_channel':\r
+ panel.addMsg(' ', '=== ' + data.channel + ' is invite only.', 'status');\r
+ kiwi.app.message.text(data.channel + ' is invite only');\r
+ break;\r
+ case 'channel_is_full':\r
+ panel.addMsg(' ', '=== ' + data.channel + ' is full.', 'status');\r
+ kiwi.app.message.text(data.channel + ' is full');\r
+ break;\r
+ case 'chanop_privs_needed':\r
+ panel.addMsg(' ', '=== ' + data.reason, 'status');\r
+ kiwi.app.message.text(data.reason + ' (' + data.channel + ')');\r
+ break;\r
+ case 'no_such_nick':\r
+ tmp = kiwi.app.panels.getByName(data.nick);\r
+ if (tmp) {\r
+ tmp.addMsg(' ', '=== ' + data.nick + ': ' + data.reason, 'status');\r
+ } else {\r
+ kiwi.app.panels.server.addMsg(' ', '=== ' + data.nick + ': ' + data.reason, 'status');\r
+ }\r
+ break;\r
+ case 'nickname_in_use':\r
+ kiwi.app.panels.server.addMsg(' ', '=== The nickname ' + data.nick + ' is already in use. Please select a new nickname', 'status');\r
+ if (kiwi.app.panels.server !== kiwi.app.panels.active) {\r
+ kiwi.app.message.text('The nickname "' + data.nick + '" is already in use. Please select a new nickname');\r
+ }\r
+ // TODO: Show a nick change box or something\r
+ break;\r
+ default:\r
+ // We don't know what data contains, so don't do anything with it.\r
+ //kiwi.front.tabviews.server.addMsg(null, ' ', '=== ' + data, 'status');\r
+ }\r
+ });\r
};\r
\r
\r
// Defaults\r
opt = opt || {};\r
opt.type = opt.type || '';\r
+ opt.timeout = opt.timeout || 5000;\r
\r
this.$el.text(text).attr('class', opt.type);\r
this.$el.slideDown(kiwi.app.view.doLayout);\r
// Defaults\r
opt = opt || {};\r
opt.type = opt.type || '';\r
+ opt.timeout = opt.timeout || 5000;\r
\r
this.$el.html(text).attr('class', opt.type);\r
this.$el.slideDown(kiwi.app.view.doLayout);\r