diff options
author | Max Teufel <max@teufelsnetz.com> | 2014-11-22 10:08:33 +0100 |
---|---|---|
committer | Max Teufel <max@teufelsnetz.com> | 2014-11-22 13:44:44 +0100 |
commit | 78234956b064f547b0ff047c6247e4148dd71473 (patch) | |
tree | 3f305473509bb213f059f4ee45ae82c42a60475f /src/plugins/irc/irc-protocol.c | |
parent | e460d48d485d3a1ff21939ce5c47cc0d7f7d8f97 (diff) | |
download | weechat-78234956b064f547b0ff047c6247e4148dd71473.zip |
irc: add option irc.server.*.sasl_disconnect_on_fail (task #12204)
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 0d8cf82f2..b6b3c97c4 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -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"); |