From 7a0d3469333710e3dd6a27466dfb35533deb7a1e Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 18 Nov 2011 16:00:12 +0100 Subject: irc: remove autorejoin on channels when disconnected from server (bug #32207) --- src/plugins/irc/irc-channel.c | 2 +- src/plugins/irc/irc-server.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 82d48b4c6..9348e7ee2 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -814,7 +814,7 @@ irc_channel_free (struct t_irc_server *server, struct t_irc_channel *channel) if (channel->pv_remote_nick_color) free (channel->pv_remote_nick_color); if (channel->hook_autorejoin) - weechat_unhook(channel->hook_autorejoin); + weechat_unhook (channel->hook_autorejoin); if (channel->nicks_speaking[0]) weechat_list_free (channel->nicks_speaking[0]); if (channel->nicks_speaking[1]) diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index c6811c0f8..8f323bc1a 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3624,6 +3624,11 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, ptr_channel = ptr_channel->next_channel) { irc_nick_free_all (server, ptr_channel); + if (ptr_channel->hook_autorejoin) + { + weechat_unhook (ptr_channel->hook_autorejoin); + ptr_channel->hook_autorejoin = NULL; + } weechat_printf (ptr_channel->buffer, _("%s%s: disconnected from server"), "", -- cgit v1.2.3