summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-10-28 07:31:21 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-10-28 07:31:21 +0000
commite26772dcdb42b1cd36c52b055d669210160ce1a0 (patch)
tree567c1de16434fb3bb5677d4a29f4664e522d4de4 /src/irc
parent232b5684cad3ccfe03ccfbe3697fb347d5da44c9 (diff)
downloadweechat-e26772dcdb42b1cd36c52b055d669210160ce1a0.zip
Added new return codes for plugin handlers, to discard messages for WeeChat, plugins, or both.
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-recv.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 7d35b9786..1c4ef52e9 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -226,6 +226,21 @@ irc_recv_command (t_irc_server *server, char *entire_line,
if (irc_commands[i].recv_function != NULL)
{
command_ignored = ignore_check (host, irc_commands[i].command_name, NULL, server->name);
+#ifdef PLUGINS
+ if (!command_ignored)
+ {
+ return_code = plugin_msg_handler_exec (server->name,
+ irc_commands[i].command_name,
+ entire_line);
+ /* plugin handler choosed to discard message for WeeChat,
+ so we don't execute WeeChat standard handler for IRC message! */
+ if (return_code & PLUGIN_RC_OK_IGNORE_WEECHAT)
+ return 0;
+ }
+#else
+ /* make gcc happy */
+ (void) entire_line;
+#endif
pos = (host) ? strchr (host, '!') : NULL;
if (pos)
pos[0] = '\0';
@@ -235,13 +250,6 @@ irc_recv_command (t_irc_server *server, char *entire_line,
return_code = (int) (irc_commands[i].recv_function) (server, host, nick, arguments);
if (nick)
free (nick);
-#ifdef PLUGINS
- if (!command_ignored)
- plugin_msg_handler_exec (server->name, irc_commands[i].command_name, entire_line);
-#else
- /* make gcc happy */
- (void) entire_line;
-#endif
return return_code;
}