From 9d717ffee9d3ebb88c08312a3c8bd20f24c1dd8e Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 18 May 2013 22:09:44 +0200 Subject: Fix text event for erroneous nicks --- src/common/inbound.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/common/inbound.c') diff --git a/src/common/inbound.c b/src/common/inbound.c index 3025ebf7..06cabd45 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -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: -- cgit 1.4.1