}
break;
+ case 'erroneus_nickname':
+ this.panels.server.addMsg(' ', '== The nickname ' + event.nick + ' is not valid for this network. Please select a new nickname', 'status');
+ if (this.panels.server !== this.panels.active) {
+ _kiwi.app.message.text('The nickname "' + event.nick + '" is not valid for this network. Please select a new nickname');
+ }
+
+ // Only show the nickchange component if the controlbox is open
+ if (_kiwi.app.controlbox.$el.css('display') !== 'none') {
+ (new _kiwi.view.NickChangeBox()).render();
+ }
+ break;
case 'password_mismatch':
this.panels.server.addMsg(' ', '== Incorrect password given', 'status');
onIrcError: function (data) {
$('button', this.$el).attr('disabled', null);
- if (data.error == 'nickname_in_use') {
+ switch(data.error) {
+ case 'nickname_in_use':
this.setStatus('Nickname already taken');
this.show('nick_change');
- }
-
- if (data.error == 'password_mismatch') {
+ this.$el.find('.nick').select();
+ break;
+ case 'erroneus_nickname':
+ this.setStatus('Erroneus nickname');
+ this.show('nick_change');
+ this.$el.find('.nick').select();
+ break;
+ case 'password_mismatch':
this.setStatus('Incorrect Password');
this.show('nick_change');
- that.$el.find('.password').select();
+ this.$el.find('.password').select();
+ break;
}
},
'405': 'ERR_TOOMANYCHANNELS',
'421': 'ERR_UNKNOWNCOMMAND',
'422': 'ERR_NOMOTD',
+ '432': 'ERR_ERRONEUSNICKNAME',
'433': 'ERR_NICKNAMEINUSE',
'441': 'ERR_USERNOTINCHANNEL',
'442': 'ERR_NOTONCHANNEL',
});
},
+ ERR_ERRONEUSNICKNAME: function(command) {
+ this.irc_connection.emit('server ' + this.irc_connection.irc_host.hostname + ' erroneus_nickname', {
+ nick: command.params[1],
+ reason: command.trailing
+ });
+ },
+
ERR_NOTREGISTERED: function (command) {
},
banned_from_channel: onBannedFromChannel,
bad_channel_key: onBadChannelKey,
chanop_privs_needed: onChanopPrivsNeeded,
- nickname_in_use: onNicknameInUse
+ nickname_in_use: onNicknameInUse,
+ erroneus_nickname: onErroneusNickname
};
EventBinder.bindIrcEvents('server *', this.irc_events, this, this.irc_connection);
reason: event.reason
});
}
+
+function onErroneusNickname(event) {
+ this.irc_connection.clientEvent('irc_error', {
+ error: 'erroneus_nickname',
+ nick: event.nick,
+ reason: event.reason
+ });
+}