summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSimmo Saan <simmo.saan@gmail.com>2016-12-31 19:35:51 +0200
committerSimmo Saan <simmo.saan@gmail.com>2016-12-31 19:44:47 +0200
commitb30c6786b411e360a0034e5f3eb5001e0b303240 (patch)
tree98903bf7add1fa8a4245491561f247c71f5e068a /src/plugins/irc
parent5a8ff45c4554a7141a2030be8f3996baa076d7a6 (diff)
downloadweechat-b30c6786b411e360a0034e5f3eb5001e0b303240.zip
irc: fix buffer switching on manual join for forwarded channels
Previously using option values irc.look.buffer_open_before_join off irc.look.buffer_switch_join on and manually joining a channel which gets forwarded (e.g. #linux -> ##linux-overflow on freenode) the channel buffer for ##linux-overflow was not switched to even though the option says it should have. This patch copies manual join and noswitch information for channels which get forwarded.
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-protocol.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 5ae43428f..22694732c 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -5075,6 +5075,7 @@ IRC_PROTOCOL_CALLBACK(470)
struct t_gui_buffer *ptr_buffer;
struct t_gui_lines *own_lines;
const char *buffer_name, *short_name, *localvar_channel;
+ char *old_channel_lower, *new_channel_lower;
int lines_count;
irc_protocol_cb_generic_error (server,
@@ -5126,6 +5127,46 @@ IRC_PROTOCOL_CALLBACK(470)
ptr_buffer);
}
}
+
+
+ old_channel_lower = strdup (argv[3]);
+ if (old_channel_lower)
+ {
+ weechat_string_tolower (old_channel_lower);
+ new_channel_lower = strdup (argv[4]);
+ if (new_channel_lower)
+ {
+ weechat_string_tolower (new_channel_lower);
+
+ if (weechat_hashtable_has_key (server->join_manual,
+ old_channel_lower))
+ {
+ weechat_hashtable_set (server->join_manual,
+ new_channel_lower,
+ weechat_hashtable_get (
+ server->join_manual,
+ old_channel_lower));
+ weechat_hashtable_remove (server->join_manual,
+ old_channel_lower);
+ }
+
+ if (weechat_hashtable_has_key (server->join_noswitch,
+ old_channel_lower))
+ {
+ weechat_hashtable_set (server->join_noswitch,
+ new_channel_lower,
+ weechat_hashtable_get (
+ server->join_noswitch,
+ old_channel_lower));
+ weechat_hashtable_remove (server->join_noswitch,
+ old_channel_lower);
+ }
+
+ free (new_channel_lower);
+ }
+
+ free (old_channel_lower);
+ }
}
return WEECHAT_RC_OK;