diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-17 12:55:39 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-17 12:55:39 +0100 |
commit | fb31cf663ecdf8daae44dfa519f605b4ec059f46 (patch) | |
tree | dfa93cd0879538bf387551076fc4dc1c24da7650 | |
parent | 122a0f80974a0e120032374a712309c9920899a5 (diff) | |
download | weechat-fb31cf663ecdf8daae44dfa519f605b4ec059f46.zip |
irc: do not join channels in server autojoin option after reconnection to the server (closes #560, bug #21529)
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 48 |
2 files changed, 28 insertions, 21 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 805474a24..599b22eac 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -37,6 +37,7 @@ Bug fixes:: * api: send NULL values to config section callbacks in scripting API (issue #1843) * api: fix function string_cut when there are non printable chars in suffix * api: do not expect any return value in callbacks "callback_change" and "callback_delete" of function config_new_option (scripting API) + * irc: do not join channels in server autojoin option after reconnection to the server (issue #560, bug #21529) * irc: escape backslashes in raw buffer (issue #1838) * trigger: fix variables sent to focus callback (issue #1858) diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 499dd151a..45c3519cc 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -5707,30 +5707,36 @@ irc_server_autojoin_channels (struct t_irc_server *server) { char *autojoin; - /* auto-join after disconnection (only rejoins opened channels) */ - if (!server->disable_autojoin && server->reconnect_join && server->channels) + if (!server->disable_autojoin) { - autojoin = irc_server_build_autojoin (server); - if (autojoin) + /* auto-join after disconnection (only rejoins opened channels) */ + if (server->reconnect_join) { - irc_server_sendf (server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "JOIN %s", - autojoin); - free (autojoin); + if (server->channels) + { + autojoin = irc_server_build_autojoin (server); + if (autojoin) + { + irc_server_sendf (server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "JOIN %s", + autojoin); + free (autojoin); + } + } + server->reconnect_join = 0; + } + else + { + /* auto-join when connecting to server for first time */ + autojoin = irc_server_eval_expression ( + server, + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_AUTOJOIN)); + if (autojoin && autojoin[0]) + irc_command_join_server (server, autojoin, 0, 0); + if (autojoin) + free (autojoin); } - server->reconnect_join = 0; - } - else - { - /* auto-join when connecting to server for first time */ - autojoin = irc_server_eval_expression ( - server, - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_AUTOJOIN)); - if (!server->disable_autojoin && autojoin && autojoin[0]) - irc_command_join_server (server, autojoin, 0, 0); - if (autojoin) - free (autojoin); } server->disable_autojoin = 0; |