1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

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 9749b65f7e.
This commit is contained in:
Sébastien Helleu
2015-01-23 20:02:25 +01:00
parent ba5e657b3c
commit a617cd857a
+9 -3
View File
@@ -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;