summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-channel.c2
-rw-r--r--src/plugins/irc/irc-server.c5
2 files changed, 6 insertions, 1 deletions
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"),
"",