summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-server.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-11-24 20:26:06 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-11-24 20:26:06 +0100
commit4fca6c58c8d817363a20da6691c1e9705f6234f1 (patch)
tree1ba3a807be7f22dece1136dde07bc26779ebc5e0 /src/plugins/irc/irc-server.c
parent9e9dd27bb3240731a33a431e5679dd974cd0b1c0 (diff)
downloadweechat-4fca6c58c8d817363a20da6691c1e9705f6234f1.zip
irc: add a condition for colon before the password in PASS message (issue #602)
Some weird IRC servers may refuse a PASS command with a colon, so we send a colon only if the password contains spaces or begins with a colon.
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r--src/plugins/irc/irc-server.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 678236200..b81434787 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -3328,7 +3328,13 @@ irc_server_login (struct t_irc_server *server)
server, IRC_SERVER_OPTION_CAPABILITIES);
if (password && password[0])
- irc_server_sendf (server, 0, NULL, "PASS :%s", password);
+ {
+ irc_server_sendf (
+ server, 0, NULL,
+ "PASS %s%s",
+ ((password[0] == ':') || (strchr (password, ' '))) ? ":" : "",
+ password);
+ }
if (!server->nick)
{