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 /src/plugins/irc/irc-server.c | |
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)
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r-- | src/plugins/irc/irc-server.c | 48 |
1 files changed, 27 insertions, 21 deletions
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; |