1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

Added new return code in plugin API to force highlight (for message handlers only)

This commit is contained in:
Sebastien Helleu
2007-03-06 16:42:39 +00:00
parent 00dd81761f
commit 7b9ef6b56e
16 changed files with 66 additions and 4 deletions
+12 -1
View File
@@ -50,7 +50,7 @@
char *irc_last_command_received = NULL;
int command_ignored;
int command_ignored, command_force_highlight;
/*
@@ -105,6 +105,10 @@ irc_is_highlight (char *message, char *nick)
/* empty message ? */
if (!message || !message[0])
return 0;
/* highlight asked by a plugin */
if (command_force_highlight)
return 1;
/* highlight by nickname */
match = strstr (message, nick);
@@ -272,6 +276,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
cmd_name,
NULL,
server->name);
command_force_highlight = 0;
#ifdef PLUGINS
return_code = plugin_msg_handler_exec (server->name,
cmd_name,
@@ -280,6 +285,12 @@ irc_recv_command (t_irc_server *server, char *entire_line,
so we ignore this message in standard handler */
if (return_code & PLUGIN_RC_OK_IGNORE_WEECHAT)
command_ignored = 1;
/* plugin asked for highlight ? */
if (return_code & PLUGIN_RC_OK_WITH_HIGHLIGHT)
{
command_force_highlight = 1;
gui_printf (NULL, "highlight!!!\n");
}
#endif
pos = (dup_host) ? strchr (dup_host, '!') : NULL;
if (pos)