summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index e662e8fc7..a68534cbc 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -5446,7 +5446,11 @@ IRC_PROTOCOL_CALLBACK(432)
irc_server_set_nick (server, alternate_nick);
- irc_server_sendf (server, 0, NULL, "NICK :%s", server->nick);
+ irc_server_sendf (
+ server, 0, NULL,
+ "NICK %s%s",
+ (server->nick && strchr (server->nick, ':')) ? ":" : "",
+ server->nick);
}
return WEECHAT_RC_OK;
@@ -5490,7 +5494,11 @@ IRC_PROTOCOL_CALLBACK(433)
irc_server_set_nick (server, alternate_nick);
- irc_server_sendf (server, 0, NULL, "NICK :%s", server->nick);
+ irc_server_sendf (
+ server, 0, NULL,
+ "NICK %s%s",
+ (server->nick && strchr (server->nick, ':')) ? ":" : "",
+ server->nick);
}
else
{
@@ -5548,7 +5556,11 @@ IRC_PROTOCOL_CALLBACK(437)
irc_server_set_nick (server, alternate_nick);
- irc_server_sendf (server, 0, NULL, "NICK :%s", server->nick);
+ irc_server_sendf (
+ server, 0, NULL,
+ "NICK %s%s",
+ (server->nick && strchr (server->nick, ':')) ? ":" : "",
+ server->nick);
}
}