summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-05-14 15:04:08 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-05-14 15:33:30 +0200
commit060cb48094f6a9d187d4645ecb1ec4cd4f374931 (patch)
tree818d4ee9df262662344b158247d5bce0e51c993f /src/plugins/irc
parent283c9d7ccffbcae0eee8fb3693597973b2fca55a (diff)
downloadweechat-060cb48094f6a9d187d4645ecb1ec4cd4f374931.zip
irc: ignore BATCH commands when capability "batch" is not enabled (issue #1292)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-protocol.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index f4fab5a0c..239e3dbca 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -668,6 +668,10 @@ IRC_PROTOCOL_CALLBACK(batch)
IRC_PROTOCOL_MIN_PARAMS(1);
+ /* do nothing (but ignore BATCH) if capability "batch" is not enabled */
+ if (!weechat_hashtable_has_key (server->cap_list, "batch"))
+ return WEECHAT_RC_OK;
+
if (params[0][0] == '+')
{
/* start batch */
@@ -7784,7 +7788,8 @@ irc_protocol_recv_command (struct t_irc_server *server,
/* if message is not BATCH but has a batch tag, just store it for later */
if (!ignore_batch_tag
&& hash_tags
- && (weechat_strcasecmp (msg_command, "batch") != 0))
+ && (weechat_strcasecmp (msg_command, "batch") != 0)
+ && weechat_hashtable_has_key (server->cap_list, "batch"))
{
ptr_batch_ref = weechat_hashtable_get (hash_tags, "batch");
if (ptr_batch_ref)