summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-03-24 19:02:01 +0100
committerSébastien Helleu <flashcode@flashtux.org>2018-03-24 19:02:01 +0100
commit1dff6613566e85a3e48d5ed53e78bac390ff1864 (patch)
tree1ae3c61212eb5233092eae472aa762c95d9fcd51 /src
parent4bdda6dd0accedb0e8a3fc9c04dc1b0cb7f7aa75 (diff)
downloadweechat-1dff6613566e85a3e48d5ed53e78bac390ff1864.zip
irc: clear the modelist if nothing was received before the end of list (invite/exception/ban/quiet)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-protocol.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 50924f46f..5920fabc5 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4029,7 +4029,17 @@ IRC_PROTOCOL_CALLBACK(347)
ptr_channel->buffer : server->buffer;
ptr_modelist = irc_modelist_search (ptr_channel, 'I');
if (ptr_modelist)
+ {
+ if (ptr_modelist->state != IRC_MODELIST_STATE_RECEIVING)
+ {
+ /*
+ * remove all items if no invite was received before
+ * the end of invite list
+ */
+ irc_modelist_item_free_all (ptr_modelist);
+ }
ptr_modelist->state = IRC_MODELIST_STATE_RECEIVED;
+ }
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL, command, "invitelist", ptr_buffer),
@@ -4191,7 +4201,17 @@ IRC_PROTOCOL_CALLBACK(349)
ptr_channel->buffer : server->buffer;
ptr_modelist = irc_modelist_search (ptr_channel, 'e');
if (ptr_modelist)
+ {
+ if (ptr_modelist->state != IRC_MODELIST_STATE_RECEIVING)
+ {
+ /*
+ * remove all items if no exception was received before
+ * the end of exception list
+ */
+ irc_modelist_item_free_all (ptr_modelist);
+ }
ptr_modelist->state = IRC_MODELIST_STATE_RECEIVED;
+ }
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL, command, "exceptionlist", ptr_buffer),
@@ -4982,7 +5002,17 @@ IRC_PROTOCOL_CALLBACK(368)
ptr_channel->buffer : server->buffer;
ptr_modelist = irc_modelist_search (ptr_channel, 'b');
if (ptr_modelist)
+ {
+ if (ptr_modelist->state != IRC_MODELIST_STATE_RECEIVING)
+ {
+ /*
+ * remove all items if no ban was received before
+ * the end of ban list
+ */
+ irc_modelist_item_free_all (ptr_modelist);
+ }
ptr_modelist->state = IRC_MODELIST_STATE_RECEIVED;
+ }
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL, command, "banlist", ptr_buffer),
@@ -5443,7 +5473,17 @@ IRC_PROTOCOL_CALLBACK(729)
ptr_channel->buffer : server->buffer;
ptr_modelist = irc_modelist_search (ptr_channel, argv[4][0]);
if (ptr_modelist)
+ {
+ if (ptr_modelist->state != IRC_MODELIST_STATE_RECEIVING)
+ {
+ /*
+ * remove all items if no quiet was received before
+ * the end of quiet list
+ */
+ irc_modelist_item_free_all (ptr_modelist);
+ }
ptr_modelist->state = IRC_MODELIST_STATE_RECEIVED;
+ }
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL, command, "quietlist", ptr_buffer),