From a10b2bc36ae9ef154e213a06521fea3e84963885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 25 Apr 2017 20:31:08 +0200 Subject: [PATCH] buflist: add option buflist.format.nick_prefix --- po/cs.po | 12 +++++++++++- po/de.po | 14 +++++++++++++- po/es.po | 12 +++++++++++- po/fr.po | 21 ++++++++++++++++++--- po/hu.po | 12 +++++++++++- po/it.po | 14 +++++++++++++- po/ja.po | 14 +++++++++++++- po/pl.po | 13 ++++++++++++- po/pt.po | 13 ++++++++++++- po/pt_BR.po | 14 +++++++++++++- po/ru.po | 12 +++++++++++- po/tr.po | 11 ++++++++++- po/weechat.pot | 11 ++++++++++- src/plugins/buflist/buflist-bar-item.c | 18 ++++++++++++++---- src/plugins/buflist/buflist-command.c | 8 ++++++-- src/plugins/buflist/buflist-config.c | 12 +++++++++++- src/plugins/buflist/buflist-config.h | 1 + 17 files changed, 190 insertions(+), 22 deletions(-) diff --git a/po/cs.po b/po/cs.po index 25b18cbc4..bff4d43ac 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 21:59+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4931,6 +4931,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5054,6 +5058,12 @@ msgid "" "help buflist)" msgstr "příkaz spuštěný při startu WeeChat, před načtením pluginů" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "příkaz spuštěný při startu WeeChat, před načtením pluginů" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/de.po b/po/de.po index c9062cccd..29ae4ff01 100644 --- a/po/de.po +++ b/po/de.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-04-24 22:21+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -5785,6 +5785,7 @@ msgstr "Liste von Buffern" msgid "bar item with list of buffers" msgstr "Bar-Item mit der Liste von Buffern" +#, fuzzy msgid "" "refresh: force the refresh of the \"buflist\" bar item\n" "\n" @@ -5813,6 +5814,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -6011,6 +6016,13 @@ msgstr "" "Format für die Anzeige der Verzögerungsanzeige für IRC Serverbuffer " "(Hinweis: Inhalt wird evaluiert, siehe /help buflist)" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"Format der Hotlist (Hinweis: Inhalt wird evaluiert, siehe /help buflist)" + msgid "" "format for buffer number, ${number} is the indented number (note: content is " "evaluated, see /help buflist)" diff --git a/po/es.po b/po/es.po index 1aebd7fa1..cc1b10c7a 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 22:01+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5144,6 +5144,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5267,6 +5271,12 @@ msgid "" "help buflist)" msgstr "comando ejecutado cuando WeeChat inicia, antes de cargar los plugins" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "comando ejecutado cuando WeeChat inicia, antes de cargar los plugins" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/fr.po b/po/fr.po index 7350a083a..c47ae442b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" -"PO-Revision-Date: 2017-04-24 22:35+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" +"PO-Revision-Date: 2017-04-25 20:30+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -5686,6 +5686,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5727,7 +5731,11 @@ msgstr "" "tampons\n" " - ${indent} : indentation pour le nom (les tampons de canaux ou privés " "sont indentés) (évaluation de l'option buflist.format.indent)\n" -" - ${nick_prefix} : le préfixe du pseudo pour un cancl (défini seulement " +" - ${format_nick_prefix} : le préfixe du pseudo en couleur pour un canal " +"(évaluation de l'option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix} : la couleur du préfixe du pseudo pour un canal " +"(défini seulement si l'option buflist.look.nick_prefix est activée)\n" +" - ${nick_prefix} : le préfixe du pseudo pour un canal (défini seulement " "si l'option buflist.look.nick_prefix est activée)\n" " - ${name} : le nom court (si défini), sinon le nom\n" " - ${color_hotlist} : la couleur qui dépend du niveau de hotlist le plus " @@ -5881,6 +5889,13 @@ msgstr "" "format pour le lag sur un tampon de serveur IRC (note : le contenu est " "évalué, voir /help buflist)" +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"format pour un préfixe de pseudo sur un canal (note : le contenu est évalué, " +"voir /help buflist)" + msgid "" "format for buffer number, ${number} is the indented number (note: content is " "evaluated, see /help buflist)" diff --git a/po/hu.po b/po/hu.po index 3406594e1..fe4d65979 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 22:03+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4468,6 +4468,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -4589,6 +4593,12 @@ msgid "" "help buflist)" msgstr "felhasználónév az IRC szerveren" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "felhasználónév az IRC szerveren" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/it.po b/po/it.po index ed3f0ec0f..aeb411700 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 22:04+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5282,6 +5282,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5427,6 +5431,14 @@ msgstr "" "password per il server (nota: il contenuto viene valutato, consultare /help " "eval)" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"password per il server (nota: il contenuto viene valutato, consultare /help " +"eval)" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/ja.po b/po/ja.po index 4e7a1c7aa..7989c8cd5 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-04-23 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -5536,6 +5536,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5677,6 +5681,13 @@ msgid "" msgstr "" "hasło dla serwera (uwaga: zawartość jest przetwarzana, zobacz /help eval)" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"hasło dla serwera (uwaga: zawartość jest przetwarzana, zobacz /help eval)" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/pt.po b/po/pt.po index 079285dfd..b4076ac61 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-04-08 14:50+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5538,6 +5538,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5676,6 +5680,13 @@ msgid "" msgstr "" "palavra-passe para o servidor (nota: o conteúdo é avaliado, ver /help eval)" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"palavra-passe para o servidor (nota: o conteúdo é avaliado, ver /help eval)" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/pt_BR.po b/po/pt_BR.po index a537b7339..79be47798 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2016-09-03 08:24+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -5084,6 +5084,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -5229,6 +5233,14 @@ msgstr "" "comando executado quando o WeeChat inicia, antes do carregamento dos plugins " "(nota: conteúdo é avaliado, veja /help eval)" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" +"comando executado quando o WeeChat inicia, antes do carregamento dos plugins " +"(nota: conteúdo é avaliado, veja /help eval)" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/ru.po b/po/ru.po index 2835866c3..5b62917b6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 22:06+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4506,6 +4506,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -4627,6 +4631,12 @@ msgid "" "help buflist)" msgstr "ник, используемый на IRC сервере" +#, fuzzy +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "ник, используемый на IRC сервере" + #, fuzzy msgid "" "format for buffer number, ${number} is the indented number (note: content is " diff --git a/po/tr.po b/po/tr.po index 4f15ef30f..fb359a28e 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2017-01-06 22:07+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -4071,6 +4071,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -4182,6 +4186,11 @@ msgid "" "help buflist)" msgstr "" +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" + msgid "" "format for buffer number, ${number} is the indented number (note: content is " "evaluated, see /help buflist)" diff --git a/po/weechat.pot b/po/weechat.pot index 9a99de944..0df1574b9 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-04-24 22:34+0200\n" +"POT-Creation-Date: 2017-04-25 19:42+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4056,6 +4056,10 @@ msgid "" "and 99 buffers\n" " - ${indent}: indentation for name (channel and private buffers are " "indented) (evaluation of option buflist.format.indent)\n" +" - ${format_nick_prefix}: colored nick prefix for a channel (evaluation " +"of option buflist.format.nick_prefix)\n" +" - ${color_nick_prefix}: color of nick prefix for a channel (set only if " +"the option buflist.look.nick_prefix is enabled)\n" " - ${nick_prefix}: nick prefix for a channel (set only if the option " "buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the name\n" @@ -4167,6 +4171,11 @@ msgid "" "help buflist)" msgstr "" +msgid "" +"format for nick prefix on a channel (note: content is evaluated, see /help " +"buflist)" +msgstr "" + msgid "" "format for buffer number, ${number} is the indented number (note: content is " "evaluated, see /help buflist)" diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 218b9bb6f..5220a23d5 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -54,7 +54,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, struct t_gui_hotlist *ptr_hotlist; char **buflist, *str_buflist, *condition; char str_format_number[32], str_format_number_empty[32]; - char str_nick_prefix[32]; + char str_nick_prefix[32], str_color_nick_prefix[32]; char str_number[32], *line, **hotlist, *str_hotlist; char str_hotlist_count[32]; const char *ptr_format, *ptr_format_current, *ptr_format_indent; @@ -172,6 +172,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, /* nick prefix */ str_nick_prefix[0] = '\0'; + str_color_nick_prefix[0] = '\0'; if (is_channel && weechat_config_boolean (buflist_config_look_nick_prefix)) { @@ -190,12 +191,15 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, ptr_buffer, ptr_gui_nick, "prefix"); if (ptr_nick_prefix && (ptr_nick_prefix[0] != ' ')) { - snprintf (str_nick_prefix, sizeof (str_nick_prefix), - "%s%s", + snprintf (str_color_nick_prefix, + sizeof (str_color_nick_prefix), + "%s", weechat_color ( weechat_nicklist_nick_get_string ( ptr_buffer, ptr_gui_nick, - "prefix_color")), + "prefix_color"))); + snprintf (str_nick_prefix, sizeof (str_nick_prefix), + "%s", ptr_nick_prefix); } } @@ -203,6 +207,12 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, } weechat_hashtable_set (buflist_hashtable_extra_vars, "nick_prefix", str_nick_prefix); + weechat_hashtable_set (buflist_hashtable_extra_vars, + "color_nick_prefix", str_color_nick_prefix); + weechat_hashtable_set (buflist_hashtable_extra_vars, + "format_nick_prefix", + weechat_config_string ( + buflist_config_format_nick_prefix)); /* set extra variables */ weechat_hashtable_set (buflist_hashtable_extra_vars, diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c index 606117331..342b84f4c 100644 --- a/src/plugins/buflist/buflist-command.c +++ b/src/plugins/buflist/buflist-command.c @@ -100,8 +100,12 @@ buflist_command_init () " - ${indent}: indentation for name (channel and private " "buffers are indented) (evaluation of " "option buflist.format.indent)\n" - " - ${nick_prefix}: nick prefix for a channel (set only " - "if the option buflist.look.nick_prefix is enabled)\n" + " - ${format_nick_prefix}: colored nick prefix for a channel " + "(evaluation of option buflist.format.nick_prefix)\n" + " - ${color_nick_prefix}: color of nick prefix for a channel " + "(set only if the option buflist.look.nick_prefix is enabled)\n" + " - ${nick_prefix}: nick prefix for a channel " + "(set only if the option buflist.look.nick_prefix is enabled)\n" " - ${name}: the short name (if set), with a fallback on the " "name\n" " - ${color_hotlist}: the color depending on the highest " diff --git a/src/plugins/buflist/buflist-config.c b/src/plugins/buflist/buflist-config.c index 0ae5dbc0b..9398b4d0e 100644 --- a/src/plugins/buflist/buflist-config.c +++ b/src/plugins/buflist/buflist-config.c @@ -51,6 +51,7 @@ struct t_config_option *buflist_config_format_hotlist_level_none; struct t_config_option *buflist_config_format_hotlist_separator; struct t_config_option *buflist_config_format_indent; struct t_config_option *buflist_config_format_lag; +struct t_config_option *buflist_config_format_nick_prefix; struct t_config_option *buflist_config_format_number; struct t_hook **buflist_config_signals_refresh = NULL; @@ -395,7 +396,7 @@ buflist_config_init () N_("format of each line with a buffer " "(note: content is evaluated, see /help buflist)"), NULL, 0, 0, - "${format_number}${indent}${nick_prefix}${color_hotlist}${name}", + "${format_number}${indent}${format_nick_prefix}${color_hotlist}${name}", NULL, 0, NULL, NULL, NULL, &buflist_config_change_buflist, NULL, NULL, @@ -494,6 +495,15 @@ buflist_config_init () NULL, NULL, NULL, &buflist_config_change_buflist, NULL, NULL, NULL, NULL, NULL); + buflist_config_format_nick_prefix = weechat_config_new_option ( + buflist_config_file, ptr_section, + "nick_prefix", "string", + N_("format for nick prefix on a channel " + "(note: content is evaluated, see /help buflist)"), + NULL, 0, 0, "${color_nick_prefix}${nick_prefix}", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_buflist, NULL, NULL, + NULL, NULL, NULL); buflist_config_format_number = weechat_config_new_option ( buflist_config_file, ptr_section, "number", "string", diff --git a/src/plugins/buflist/buflist-config.h b/src/plugins/buflist/buflist-config.h index 36935235b..f80524c32 100644 --- a/src/plugins/buflist/buflist-config.h +++ b/src/plugins/buflist/buflist-config.h @@ -49,6 +49,7 @@ extern struct t_config_option *buflist_config_format_hotlist_level_none; extern struct t_config_option *buflist_config_format_hotlist_separator; extern struct t_config_option *buflist_config_format_indent; extern struct t_config_option *buflist_config_format_lag; +extern struct t_config_option *buflist_config_format_nick_prefix; extern struct t_config_option *buflist_config_format_number; extern char **buflist_config_sort_fields;