diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-23 20:02:25 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-23 20:02:25 +0100 |
commit | a617cd857a332e1ba2dfc0918e4269804b444106 (patch) | |
tree | 8915a3dc60c604246cc8eb582c66c893c1f7f68a /src/plugins/irc | |
parent | ba5e657b3cd6eeb00c7edd9682eecbf65a500d13 (diff) | |
download | weechat-a617cd857a332e1ba2dfc0918e4269804b444106.zip |
irc: fix restore of query buffers on /upgrade (closes #315)
After /upgrade it was not possible to send a message in the query buffer or to
receive messages from this nick.
This commit fixes the search of query buffer when creating the irc channel
(with type "private").
The bug was introduced by commit 9749b65f7e67bbee55e8708e571f5cff79b1bdbe.
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index cd356b747..d16564347 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -179,7 +179,7 @@ irc_channel_search (struct t_irc_server *server, const char *channel_name) */ struct t_gui_buffer * -irc_channel_search_buffer (struct t_irc_server *server, +irc_channel_search_buffer (struct t_irc_server *server, int channel_type, const char *channel_name) { struct t_hdata *hdata_buffer; @@ -202,7 +202,10 @@ irc_channel_search_buffer (struct t_irc_server *server, if (ptr_type && ptr_type[0] && ptr_server_name && ptr_server_name[0] && ptr_channel_name && ptr_channel_name[0] - && (strcmp (ptr_type, "channel") == 0) + && (((channel_type == IRC_CHANNEL_TYPE_CHANNEL) + && (strcmp (ptr_type, "channel") == 0)) + || ((channel_type == IRC_CHANNEL_TYPE_PRIVATE) + && (strcmp (ptr_type, "private") == 0))) && (strcmp (ptr_server_name, server->name) == 0) && ((irc_server_strcasecmp (server, ptr_channel_name, channel_name) == 0))) @@ -240,9 +243,12 @@ irc_channel_create_buffer (struct t_irc_server *server, buffer_name = irc_buffer_build_name (server->name, channel_name); - ptr_buffer = irc_channel_search_buffer (server, channel_name); + ptr_buffer = irc_channel_search_buffer (server, channel_type, + channel_name); if (ptr_buffer) + { weechat_nicklist_remove_all (ptr_buffer); + } else { ptr_buffer_for_merge = NULL; |