Fix text event for erroneous nicks

This commit is contained in:
Berke Viktor 2013-05-18 22:09:44 +02:00
parent bac96d1fa8
commit 9d717ffee9
4 changed files with 40 additions and 9 deletions

View File

@ -1145,7 +1145,7 @@ check_autojoin_channels (server *serv)
}
void
inbound_next_nick (session *sess, char *nick)
inbound_next_nick (session *sess, char *nick, int error)
{
char *newnick;
server *serv = sess->server;
@ -1160,14 +1160,30 @@ inbound_next_nick (session *sess, char *nick)
net = serv->network;
/* use network specific "Second choice"? */
if (net && !(net->flags & FLAG_USE_GLOBAL) && net->nick2)
{
newnick = net->nick2;
}
serv->p_change_nick (serv, newnick);
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, newnick, NULL, NULL, 0);
if (error)
{
EMIT_SIGNAL (XP_TE_NICKERROR, sess, nick, newnick, NULL, NULL, 0);
}
else
{
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, newnick, NULL, NULL, 0);
}
break;
case 3:
serv->p_change_nick (serv, prefs.hex_irc_nick3);
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0);
if (error)
{
EMIT_SIGNAL (XP_TE_NICKERROR, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0);
}
else
{
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0);
}
break;
default:

View File

@ -20,7 +20,7 @@
#ifndef HEXCHAT_INBOUND_H
#define HEXCHAT_INBOUND_H
void inbound_next_nick (session *sess, char *nick);
void inbound_next_nick (session *sess, char *nick, int error);
void inbound_uback (server *serv);
void inbound_uaway (server *serv);
void inbound_account (server *serv, char *nick, char *account);

View File

@ -835,17 +835,26 @@ process_numeric (session * sess, int n,
inbound_login_end (sess, text);
break;
case 433: /* nickname in use */
case 432: /* erroneous nickname */
if (serv->end_of_motd)
{
goto def;
inbound_next_nick (sess, word[4]);
}
inbound_next_nick (sess, word[4], 1);
break;
case 433: /* nickname in use */
if (serv->end_of_motd)
{
goto def;
}
inbound_next_nick (sess, word[4], 0);
break;
case 437:
if (serv->end_of_motd || is_channel (serv, word[4]))
goto def;
inbound_next_nick (sess, word[4]);
inbound_next_nick (sess, word[4], 0);
break;
case 471:

View File

@ -529,13 +529,19 @@ pevt_generic_none_help
Nick Clash
XP_TE_NICKCLASH
pevt_nickclash_help
%C23*%O$t%C28$1%C already in use. Retrying with %C18$2%O...
%C23*%O$t%C28$1%C is already in use. Retrying with %C18$2%O...
2
Nick Erroneous
XP_TE_NICKERROR
pevt_nickclash_help
%C23*%O$t%C28$1%C is erroneous. Retrying with %C18$2%O...
2
Nick Failed
XP_TE_NICKFAIL
pevt_generic_none_help
%C20*%O$tNickname already in use. Use /NICK to try another.
%C20*%O$tNickname is erroneous or already in use. Use /NICK to try another.
0
No DCC