Fix text event for erroneous nicks
This commit is contained in:
parent
bac96d1fa8
commit
9d717ffee9
|
@ -1145,7 +1145,7 @@ check_autojoin_channels (server *serv)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
inbound_next_nick (session *sess, char *nick)
|
inbound_next_nick (session *sess, char *nick, int error)
|
||||||
{
|
{
|
||||||
char *newnick;
|
char *newnick;
|
||||||
server *serv = sess->server;
|
server *serv = sess->server;
|
||||||
|
@ -1160,14 +1160,30 @@ inbound_next_nick (session *sess, char *nick)
|
||||||
net = serv->network;
|
net = serv->network;
|
||||||
/* use network specific "Second choice"? */
|
/* use network specific "Second choice"? */
|
||||||
if (net && !(net->flags & FLAG_USE_GLOBAL) && net->nick2)
|
if (net && !(net->flags & FLAG_USE_GLOBAL) && net->nick2)
|
||||||
|
{
|
||||||
newnick = net->nick2;
|
newnick = net->nick2;
|
||||||
|
}
|
||||||
serv->p_change_nick (serv, newnick);
|
serv->p_change_nick (serv, newnick);
|
||||||
|
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);
|
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, newnick, NULL, NULL, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
serv->p_change_nick (serv, prefs.hex_irc_nick3);
|
serv->p_change_nick (serv, prefs.hex_irc_nick3);
|
||||||
|
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);
|
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef HEXCHAT_INBOUND_H
|
#ifndef HEXCHAT_INBOUND_H
|
||||||
#define 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_uback (server *serv);
|
||||||
void inbound_uaway (server *serv);
|
void inbound_uaway (server *serv);
|
||||||
void inbound_account (server *serv, char *nick, char *account);
|
void inbound_account (server *serv, char *nick, char *account);
|
||||||
|
|
|
@ -835,17 +835,26 @@ process_numeric (session * sess, int n,
|
||||||
inbound_login_end (sess, text);
|
inbound_login_end (sess, text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 433: /* nickname in use */
|
|
||||||
case 432: /* erroneous nickname */
|
case 432: /* erroneous nickname */
|
||||||
if (serv->end_of_motd)
|
if (serv->end_of_motd)
|
||||||
|
{
|
||||||
goto def;
|
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;
|
break;
|
||||||
|
|
||||||
case 437:
|
case 437:
|
||||||
if (serv->end_of_motd || is_channel (serv, word[4]))
|
if (serv->end_of_motd || is_channel (serv, word[4]))
|
||||||
goto def;
|
goto def;
|
||||||
inbound_next_nick (sess, word[4]);
|
inbound_next_nick (sess, word[4], 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 471:
|
case 471:
|
||||||
|
|
|
@ -529,13 +529,19 @@ pevt_generic_none_help
|
||||||
Nick Clash
|
Nick Clash
|
||||||
XP_TE_NICKCLASH
|
XP_TE_NICKCLASH
|
||||||
pevt_nickclash_help
|
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
|
2
|
||||||
|
|
||||||
Nick Failed
|
Nick Failed
|
||||||
XP_TE_NICKFAIL
|
XP_TE_NICKFAIL
|
||||||
pevt_generic_none_help
|
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
|
0
|
||||||
|
|
||||||
No DCC
|
No DCC
|
||||||
|
|
Loading…
Reference in New Issue