diff options
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-command.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 18 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 3 |
3 files changed, 20 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 19f42f1e6..ab88437c3 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -3543,7 +3543,9 @@ irc_send_nick_server (struct t_irc_server *server, const char *nickname) if (server->is_connected) { irc_server_sendf (server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "NICK :%s", nickname); + "NICK %s%s", + (nickname && strchr (nickname, ':')) ? ":" : "", + nickname); } else irc_server_set_nick (server, nickname); 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); } } diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 271a7f5d4..22907d7b7 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3760,8 +3760,9 @@ irc_server_login (struct t_irc_server *server) weechat_string_replace (username, " ", "_") : strdup ("weechat"); irc_server_sendf ( server, 0, NULL, - "NICK :%s\n" + "NICK %s%s\n" "USER %s 0 * :%s", + (server->nick && strchr (server->nick, ':')) ? ":" : "", server->nick, (username2) ? username2 : "weechat", (realname && realname[0]) ? realname : ((username2) ? username2 : "weechat")); |