From 59481611dd5b8918cc7fe1e7dc05837d1e4ae93b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 31 Jan 2014 16:41:12 +0100 Subject: [PATCH] relay: send backlog for irc private buffers --- ChangeLog | 1 + src/plugins/relay/irc/relay-irc.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b775e3c4e..852c17da8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -118,6 +118,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * lua: fix detection of Lua 5.2 in autotools (patch #8270) * lua: fix crash on calls to callbacks during load of script * python: fix load of scripts with python >= 3.3 +* relay: send backlog for irc private buffers * relay: fix memory leak on unload of relay plugin * ruby: fix ruby init with ruby >= 2.0 (bug #41115) * scripts: fix script interpreter used after register during load of script diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 38415b44f..5b805e9f7 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1077,7 +1077,9 @@ void relay_irc_send_join_channels (struct t_relay_client *client) { struct t_infolist *infolist_channels; - const char *channel; + const char *name; + int type; + struct t_gui_buffer *buffer; infolist_channels = weechat_infolist_get ("irc_channel", NULL, client->protocol_args); @@ -1085,10 +1087,22 @@ relay_irc_send_join_channels (struct t_relay_client *client) { while (weechat_infolist_next (infolist_channels)) { - if (weechat_infolist_integer (infolist_channels, "nicks_count") > 0) + name = weechat_infolist_string (infolist_channels, "name"); + type = weechat_infolist_integer (infolist_channels, "type"); + buffer = weechat_infolist_pointer (infolist_channels, "buffer"); + if (type == 0) { - channel = weechat_infolist_string (infolist_channels, "name"); - relay_irc_send_join (client, channel); + /* channel */ + if (weechat_infolist_integer (infolist_channels, + "nicks_count") > 0) + { + relay_irc_send_join (client, name); + } + } + else if (type == 1) + { + /* private */ + relay_irc_send_channel_backlog (client, name, buffer); } } weechat_infolist_free (infolist_channels);