summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-27 09:48:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-06-27 09:48:16 +0200
commitff8beb1918816ccd1c15954f7f564ab02e9cfb9f (patch)
tree30e74538429a15c36907f9266ce173de55286b93 /src/plugins/irc/irc-protocol.c
parent59853d9b303991ac4169d36c23880dcca7b90acf (diff)
downloadweechat-ff8beb1918816ccd1c15954f7f564ab02e9cfb9f.zip
irc: allow signals "irc_raw_in" and "irc_in" to eat messages (issue #1657)
This is useful to implement IRC protocol extensions which introduce new commands.
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 7cb1bfa3d..98115d261 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -6904,14 +6904,18 @@ irc_protocol_recv_command (struct t_irc_server *server,
host_no_color);
/* send signal with received command, even if command is ignored */
- irc_server_send_signal (server, "irc_raw_in", msg_command,
- irc_message, NULL);
+ return_code = irc_server_send_signal (server, "irc_raw_in", msg_command,
+ irc_message, NULL);
+ if (return_code == WEECHAT_RC_OK_EAT)
+ goto end;
/* send signal with received command, only if message is not ignored */
if (!message_ignored)
{
- irc_server_send_signal (server, "irc_in", msg_command,
- irc_message, NULL);
+ return_code = irc_server_send_signal (server, "irc_in", msg_command,
+ irc_message, NULL);
+ if (return_code == WEECHAT_RC_OK_EAT)
+ goto end;
}
/* look for IRC command */
@@ -7008,14 +7012,14 @@ irc_protocol_recv_command (struct t_irc_server *server,
/* send signal with received command (if message is not ignored) */
if (!message_ignored)
{
- irc_server_send_signal (server, "irc_in2", msg_command,
- irc_message, NULL);
+ (void) irc_server_send_signal (server, "irc_in2", msg_command,
+ irc_message, NULL);
}
}
/* send signal with received command, even if command is ignored */
- irc_server_send_signal (server, "irc_raw_in2", msg_command,
- irc_message, NULL);
+ (void) irc_server_send_signal (server, "irc_raw_in2", msg_command,
+ irc_message, NULL);
end:
if (nick)