summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-08-17 07:59:20 +0200
committerSébastien Helleu <flashcode@flashtux.org>2018-08-17 07:59:20 +0200
commit968d7ede29f92e63042a460c360c0e64361e9fdc (patch)
tree5ebc13c6f7c7245228d0faacabfebe0d6c4443f3 /src
parente7096810c43e1db561f568c2751e257a85f67aa0 (diff)
downloadweechat-968d7ede29f92e63042a460c360c0e64361e9fdc.zip
trigger: add variables "tg_prefix_nocolor" and "tg_message_nocolor" in line trigger
Diffstat (limited to 'src')
-rw-r--r--src/plugins/trigger/trigger-callback.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c
index c69a50c69..ca7d95d26 100644
--- a/src/plugins/trigger/trigger-callback.c
+++ b/src/plugins/trigger/trigger-callback.c
@@ -789,7 +789,7 @@ trigger_callback_line_cb (const void *pointer, void *data,
struct t_weelist_item *ptr_item;
long unsigned int value;
const char *ptr_key, *ptr_value;
- char **tags, *str_tags;
+ char **tags, *str_tags, *string_no_color;
int rc, num_tags, length;
TRIGGER_CALLBACK_CB_INIT(NULL);
@@ -831,6 +831,20 @@ trigger_callback_line_cb (const void *pointer, void *data,
free (str_tags);
}
+ /* build prefix without colors */
+ ptr_value = weechat_hashtable_get (line, "prefix");
+ string_no_color = weechat_string_remove_color (ptr_value, NULL);
+ weechat_hashtable_set (extra_vars, "tg_prefix_nocolor", string_no_color);
+ if (string_no_color)
+ free (string_no_color);
+
+ /* build message without colors */
+ ptr_value = weechat_hashtable_get (line, "message");
+ string_no_color = weechat_string_remove_color (ptr_value, NULL);
+ weechat_hashtable_set (extra_vars, "tg_message_nocolor", string_no_color);
+ if (string_no_color)
+ free (string_no_color);
+
if (!trigger_callback_set_tags (buffer, (const char **)tags, num_tags,
extra_vars))
{