summary refs log tree commit diff stats
path: root/src/common/inbound.c
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-05-18 22:09:44 +0200
committerBerke Viktor <bviktor@hexchat.org>2013-05-18 22:09:44 +0200
commit9d717ffee9d3ebb88c08312a3c8bd20f24c1dd8e (patch)
treefea8613b1c703934570b7461bf2c57243ec28026 /src/common/inbound.c
parentbac96d1fa8fb5c6ffd8715a25400e7759c153a21 (diff)
Fix text event for erroneous nicks
Diffstat (limited to 'src/common/inbound.c')
-rw-r--r--src/common/inbound.c22
1 files changed, 19 insertions, 3 deletions
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: