diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-29 17:44:42 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-29 17:44:42 +0100 |
commit | bf0b5f5644abbf0a79674af7e75f6e24981babfc (patch) | |
tree | e3bd5fb98c83ba64f8f0f922084e6e941644529a /src/plugins/scripts/tcl/weechat-tcl-api.c | |
parent | bc00946a0da47dbc16cefbb915ae7f94b0ac3abf (diff) | |
download | weechat-bf0b5f5644abbf0a79674af7e75f6e24981babfc.zip |
Add "displayed" and "highlight" arguments to callback for hook_print
Diffstat (limited to 'src/plugins/scripts/tcl/weechat-tcl-api.c')
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 090f999dc..4e51e24d1 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -2716,10 +2716,11 @@ int weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, time_t date, int tags_count, const char **tags, + int displayed, int highlight, const char *prefix, const char *message) { struct t_script_callback *script_callback; - char *tcl_argv[6]; + char *tcl_argv[8]; static char timebuffer[64]; int *rc, ret; @@ -2733,9 +2734,11 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, tcl_argv[0] = script_ptr2str (buffer); tcl_argv[1] = timebuffer; tcl_argv[2] = weechat_string_build_with_exploded (tags, ","); - tcl_argv[3] = (char *)prefix; - tcl_argv[4] = (char *)message; - tcl_argv[5] = NULL; + tcl_argv[3] = (displayed) ? strdup ("1") : strdup ("0"); + tcl_argv[4] = (highlight) ? strdup ("1") : strdup ("0"); + tcl_argv[5] = (char *)prefix; + tcl_argv[6] = (char *)message; + tcl_argv[7] = NULL; rc = (int *) weechat_tcl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -2753,6 +2756,10 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, free (tcl_argv[0]); if (tcl_argv[2]) free (tcl_argv[2]); + if (tcl_argv[3]) + free (tcl_argv[3]); + if (tcl_argv[4]) + free (tcl_argv[4]); return ret; } |