diff options
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 3ba40e417..b6b3c97c4 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -5076,7 +5076,7 @@ IRC_PROTOCOL_CALLBACK(901) } /* - * Callback for the IRC messages "903" to "907". + * Callback for the IRC messages "902" to "907". * * Messages look like: * :server 903 nick :SASL authentication successful @@ -5089,6 +5089,18 @@ IRC_PROTOCOL_CALLBACK(sasl_end) date, nick, address, host, command, ignored, argc, argv, argv_eol); + if (strcmp (argv[1], "903") != 0 && IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SASL_DISCONNECT_ON_FAIL)) + { + /* Check if we are already connected to the server, + * to prevent disconnects in case of 907. + */ + + if (!server->is_connected) + irc_server_disconnect (server, 0, 1); + + return WEECHAT_RC_OK; + } + if (!server->is_connected) irc_server_sendf (server, 0, NULL, "CAP END"); @@ -5363,6 +5375,7 @@ irc_protocol_recv_command (struct t_irc_server *server, { "734", /* monitor list is full */ 1, 0, &irc_protocol_cb_734 }, { "900", /* logged in as (SASL) */ 1, 0, &irc_protocol_cb_900 }, { "901", /* you are now logged in */ 1, 0, &irc_protocol_cb_901 }, + { "902", /* SASL authentication failed because account is locked or held */ 1, 0, &irc_protocol_cb_sasl_end }, { "903", /* SASL authentication successful */ 1, 0, &irc_protocol_cb_sasl_end }, { "904", /* SASL authentication failed */ 1, 0, &irc_protocol_cb_sasl_end }, { "905", /* SASL message too long */ 1, 0, &irc_protocol_cb_sasl_end }, |