diff options
-rw-r--r-- | doc/de/weechat_user.de.adoc | 28 | ||||
-rw-r--r-- | doc/en/weechat_user.en.adoc | 28 | ||||
-rw-r--r-- | doc/fr/weechat_user.fr.adoc | 28 | ||||
-rw-r--r-- | doc/it/weechat_user.it.adoc | 28 | ||||
-rw-r--r-- | doc/ja/weechat_user.ja.adoc | 30 | ||||
-rw-r--r-- | doc/pl/weechat_user.pl.adoc | 28 | ||||
-rw-r--r-- | src/plugins/trigger/trigger-callback.c | 16 |
7 files changed, 106 insertions, 80 deletions
diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index b483648d4..09b985088 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -3994,19 +3994,21 @@ Der Callback von "line" legt folgende Variablen in der Hashtable an: // TRANSLATION MISSING [width="100%",cols="3m,2,14",options="header"] |=== -| Variable | Typ | Beschreibung -| buffer | pointer | Buffer. -| buffer_name | string | Buffer name. -| buffer_type | string | Buffer type ("formatted" or "free"). -| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. -| date | string | Line date (timestamp). -| date_printed | string | Date when line was displayed (timestamp). -| str_time | string | Date for display. It may contain color codes. -| displayed | string | "1" if displayed, "0" if line filtered. -| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight -| highlight | string | "1" if highlight, otherwise "0". -| prefix | string | Prefix. -| message | string | Message. +| Variable | Typ | Beschreibung +| buffer | pointer | Buffer. +| buffer_name | string | Buffer name. +| buffer_type | string | Buffer type ("formatted" or "free"). +| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. +| date | string | Line date (timestamp). +| date_printed | string | Date when line was displayed (timestamp). +| str_time | string | Date for display. It may contain color codes. +| displayed | string | "1" if displayed, "0" if line filtered. +| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight +| highlight | string | "1" if highlight, otherwise "0". +| prefix | string | Prefix. +| tg_prefix_nocolor | string | Prefix without color codes. +| message | string | Message. +| tg_message_nocolor | string | Message without color codes. |=== // TRANSLATION MISSING diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index f8dd81d58..64c774bb2 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -3899,19 +3899,21 @@ The "line" callback sets following variables in hashtable: [width="100%",cols="3m,2,14",options="header"] |=== -| Variable | Type | Description -| buffer | pointer | Buffer. -| buffer_name | string | Buffer name. -| buffer_type | string | Buffer type ("formatted" or "free"). -| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. -| date | string | Line date (timestamp). -| date_printed | string | Date when line was displayed (timestamp). -| str_time | string | Date for display. It may contain color codes. -| displayed | string | "1" if displayed, "0" if line filtered. -| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight -| highlight | string | "1" if highlight, otherwise "0". -| prefix | string | Prefix. -| message | string | Message. +| Variable | Type | Description +| buffer | pointer | Buffer. +| buffer_name | string | Buffer name. +| buffer_type | string | Buffer type ("formatted" or "free"). +| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. +| date | string | Line date (timestamp). +| date_printed | string | Date when line was displayed (timestamp). +| str_time | string | Date for display. It may contain color codes. +| displayed | string | "1" if displayed, "0" if line filtered. +| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight +| highlight | string | "1" if highlight, otherwise "0". +| prefix | string | Prefix. +| tg_prefix_nocolor | string | Prefix without color codes. +| message | string | Message. +| tg_message_nocolor | string | Message without color codes. |=== Variables set using tags in message (they are also set in _print_ callback and diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc index 8742d08fd..a8b06e117 100644 --- a/doc/fr/weechat_user.fr.adoc +++ b/doc/fr/weechat_user.fr.adoc @@ -4030,19 +4030,21 @@ de hachage : [width="100%",cols="3m,2,14",options="header"] |=== -| Variable | Type | Description -| buffer | pointeur | Tampon. -| buffer_name | chaîne | Nom du tampon. -| buffer_type | chaîne | Type de tampon ("formatted" ou "free"). -| y | chaîne | Numéro de ligne pour un tampon avec contenu libre (≥ 0), -1 pour un tampon avec contenu formaté. -| date | chaîne | Date de la ligne (horodatage). -| date_printed | chaîne | Date d'affichage de la ligne (horodatage). -| str_time | chaîne | Date pour l'affichage. Elle peut contenir des codes couleur. -| displayed | chaîne | "1" si affichée, "0" si la ligne est filtrée. -| notify_level | chaîne | "0" = niveau bas, "1" = message, "2" = message privé, "3" = highlight -| highlight | chaîne | "1" si highlight, sinon "0". -| prefix | chaîne | Préfixe. -| message | chaîne | Message. +| Variable | Type | Description +| buffer | pointeur | Tampon. +| buffer_name | chaîne | Nom du tampon. +| buffer_type | chaîne | Type de tampon ("formatted" ou "free"). +| y | chaîne | Numéro de ligne pour un tampon avec contenu libre (≥ 0), -1 pour un tampon avec contenu formaté. +| date | chaîne | Date de la ligne (horodatage). +| date_printed | chaîne | Date d'affichage de la ligne (horodatage). +| str_time | chaîne | Date pour l'affichage. Elle peut contenir des codes couleur. +| displayed | chaîne | "1" si affichée, "0" si la ligne est filtrée. +| notify_level | chaîne | "0" = niveau bas, "1" = message, "2" = message privé, "3" = highlight +| highlight | chaîne | "1" si highlight, sinon "0". +| prefix | chaîne | Préfixe. +| tg_prefix_nocolor | chaîne | Préfixe sans les codes couleur. +| message | chaîne | Message. +| tg_message_nocolor | chaîne | Message sans les codes couleur. |=== Variables définies avec les étiquettes du message (elles sont définies aussi diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc index 8418252f2..bb3dd8261 100644 --- a/doc/it/weechat_user.it.adoc +++ b/doc/it/weechat_user.it.adoc @@ -4160,19 +4160,21 @@ The "line" callback sets following variables in hashtable: [width="100%",cols="3m,2,14",options="header"] |=== -| Variable | Type | Description -| buffer | pointer | Buffer. -| buffer_name | string | Buffer name. -| buffer_type | string | Buffer type ("formatted" or "free"). -| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. -| date | string | Line date (timestamp). -| date_printed | string | Date when line was displayed (timestamp). -| str_time | string | Date for display. It may contain color codes. -| displayed | string | "1" if displayed, "0" if line filtered. -| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight -| highlight | string | "1" if highlight, otherwise "0". -| prefix | string | Prefix. -| message | string | Message. +| Variable | Type | Description +| buffer | pointer | Buffer. +| buffer_name | string | Buffer name. +| buffer_type | string | Buffer type ("formatted" or "free"). +| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. +| date | string | Line date (timestamp). +| date_printed | string | Date when line was displayed (timestamp). +| str_time | string | Date for display. It may contain color codes. +| displayed | string | "1" if displayed, "0" if line filtered. +| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight +| highlight | string | "1" if highlight, otherwise "0". +| prefix | string | Prefix. +| tg_prefix_nocolor | string | Prefix without color codes. +| message | string | Message. +| tg_message_nocolor | string | Message without color codes. |=== Variables set using tags in message (they are also set in _print_ callback and diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index f7418665d..d52bc2959 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -3897,20 +3897,22 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の // TRANSLATION MISSING [width="100%",cols="3m,2,14",options="header"] |=== -| 変数 | 型 | 説明 -| Variable | Type | Description -| buffer | pointer | Buffer. -| buffer_name | string | Buffer name. -| buffer_type | string | Buffer type ("formatted" or "free"). -| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. -| date | string | Line date (timestamp). -| date_printed | string | Date when line was displayed (timestamp). -| str_time | string | Date for display. It may contain color codes. -| displayed | string | "1" if displayed, "0" if line filtered. -| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight -| highlight | string | "1" if highlight, otherwise "0". -| prefix | string | Prefix. -| message | string | Message. +| 変数 | 型 | 説明 +| Variable | Type | Description +| buffer | pointer | Buffer. +| buffer_name | string | Buffer name. +| buffer_type | string | Buffer type ("formatted" or "free"). +| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. +| date | string | Line date (timestamp). +| date_printed | string | Date when line was displayed (timestamp). +| str_time | string | Date for display. It may contain color codes. +| displayed | string | "1" if displayed, "0" if line filtered. +| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight +| highlight | string | "1" if highlight, otherwise "0". +| prefix | string | Prefix. +| tg_prefix_nocolor | string | Prefix without color codes. +| message | string | Message. +| tg_message_nocolor | string | Message without color codes. |=== // TRANSLATION MISSING diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc index fe138f927..b780f03fe 100644 --- a/doc/pl/weechat_user.pl.adoc +++ b/doc/pl/weechat_user.pl.adoc @@ -3931,19 +3931,21 @@ Callback "line" ustawia następujące zmienne w tablicy hashy: // TRANSLATION MISSING [width="100%",cols="3m,2,14",options="header"] |=== -| Zmienna | Typ | Opis -| buffer | wskaźnik | Buffer. -| buffer_name | ciąg | Buffer name. -| buffer_type | ciąg | Buffer type ("formatted" or "free"). -| y | ciąg | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. -| date | ciąg | Line date (timestamp). -| date_printed | ciąg | Date when line was displayed (timestamp). -| str_time | ciąg | Date for display. It may contain color codes. -| displayed | ciąg | "1" if displayed, "0" if line filtered. -| notify_level | ciąg | "0" = low level, "1" = message, "2" = private message, "3" = highlight -| highlight | ciąg | "1" if highlight, otherwise "0". -| prefix | ciąg | Prefix. -| message | ciąg | Message. +| Zmienna | Typ | Opis +| buffer | wskaźnik | Buffer. +| buffer_name | ciąg | Buffer name. +| buffer_type | ciąg | Buffer type ("formatted" or "free"). +| y | ciąg | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. +| date | ciąg | Line date (timestamp). +| date_printed | ciąg | Date when line was displayed (timestamp). +| str_time | ciąg | Date for display. It may contain color codes. +| displayed | ciąg | "1" if displayed, "0" if line filtered. +| notify_level | ciąg | "0" = low level, "1" = message, "2" = private message, "3" = highlight +| highlight | ciąg | "1" if highlight, otherwise "0". +| prefix | ciąg | Prefiks. +| tg_prefix_nocolor | ciag | Prefiks bez kodów kolorów. +| message | ciąg | Wiadomość. +| tg_message_nocolor | ciag | Wiadomość bez kodów kolorów. |=== // TRANSLATION MISSING 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)) { |