From 6f5f6da0ebd58c3c130130bb01b85b2986de35bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 11 Nov 2014 11:15:23 +0100 Subject: [PATCH] irc: add infolist "irc_color_weechat" --- ChangeLog.asciidoc | 3 +- doc/de/autogen/plugin_api/infolists.asciidoc | 2 ++ doc/en/autogen/plugin_api/infolists.asciidoc | 2 ++ doc/fr/autogen/plugin_api/infolists.asciidoc | 2 ++ doc/it/autogen/plugin_api/infolists.asciidoc | 2 ++ doc/ja/autogen/plugin_api/infolists.asciidoc | 2 ++ doc/pl/autogen/plugin_api/infolists.asciidoc | 2 ++ po/cs.po | 13 +++++++- po/de.po | 13 +++++++- po/es.po | 13 +++++++- po/fr.po | 14 ++++++-- po/hu.po | 13 +++++++- po/it.po | 13 +++++++- po/ja.po | 35 +++++++++++++------- po/pl.po | 13 +++++++- po/pt_BR.po | 13 +++++++- po/ru.po | 13 +++++++- po/tr.po | 13 +++++++- po/weechat.pot | 11 +++++- src/plugins/irc/irc-color.c | 34 +++++++++++++++++++ src/plugins/irc/irc-color.h | 1 + src/plugins/irc/irc-info.c | 20 +++++++++++ 22 files changed, 222 insertions(+), 25 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index e37a650e4..bcc93aef9 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -30,7 +30,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * api: add regex replace feature in function string_eval_expression * api: use microseconds instead of milliseconds in functions util_timeval_diff and util_timeval_add -* irc: add support for color codes 16-99 in IRC messages (closes #228) +* irc: add support for color codes 16-99 in IRC messages (closes #228), add + infolist "irc_color_weechat" * irc: disable SSLv3 by default in server option "ssl_priorities" (closes #248) * irc: add support of "extended-join" capability (closes #143, closes #212) * irc: automatically add current channel in command /samode (closes #241) diff --git a/doc/de/autogen/plugin_api/infolists.asciidoc b/doc/de/autogen/plugin_api/infolists.asciidoc index 38f35e278..08fdc1a03 100644 --- a/doc/de/autogen/plugin_api/infolists.asciidoc +++ b/doc/de/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | Liste der Channels eines IRC-Servers | Channel Pointer (optional) | Server,Channel (Channel ist optional) +| irc | irc_color_weechat | mapping between IRC color codes and WeeChat color names | - | - + | irc | irc_ignore | Liste von ignorierten IRCs | Ignore Pointer (optional) | - | irc | irc_nick | Liste der Nicks im IRC-Channel | Nick Pointer (optional) | server,channel,nick (nick ist optional) diff --git a/doc/en/autogen/plugin_api/infolists.asciidoc b/doc/en/autogen/plugin_api/infolists.asciidoc index 733bb1a75..6f6990f9f 100644 --- a/doc/en/autogen/plugin_api/infolists.asciidoc +++ b/doc/en/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | list of channels for an IRC server | channel pointer (optional) | server,channel (channel is optional) +| irc | irc_color_weechat | mapping between IRC color codes and WeeChat color names | - | - + | irc | irc_ignore | list of IRC ignores | ignore pointer (optional) | - | irc | irc_nick | list of nicks for an IRC channel | nick pointer (optional) | server,channel,nick (nick is optional) diff --git a/doc/fr/autogen/plugin_api/infolists.asciidoc b/doc/fr/autogen/plugin_api/infolists.asciidoc index 49ed4c731..9330a29e3 100644 --- a/doc/fr/autogen/plugin_api/infolists.asciidoc +++ b/doc/fr/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | liste des canaux pour un serveur IRC | pointeur vers le canal (optionnel) | serveur,canal (le canal est optionnel) +| irc | irc_color_weechat | correspondance entre les codes couleur IRC et les noms de couleur WeeChat | - | - + | irc | irc_ignore | liste des ignores IRC | pointeur vers l'ignore (optionnel) | - | irc | irc_nick | liste des pseudos pour un canal IRC | pointeur vers le pseudo (optionnel) | serveur,canal,pseudo (le pseudo est optionnel) diff --git a/doc/it/autogen/plugin_api/infolists.asciidoc b/doc/it/autogen/plugin_api/infolists.asciidoc index 0dd971039..3d2ebd2af 100644 --- a/doc/it/autogen/plugin_api/infolists.asciidoc +++ b/doc/it/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | elenco dei canali per un server IRC | puntatore al canale (opzionale) | server,canale (canale è opzionale) +| irc | irc_color_weechat | mapping between IRC color codes and WeeChat color names | - | - + | irc | irc_ignore | elenco di ignore IRC | puntatore all'ignore (opzionale) | - | irc | irc_nick | elenco dei nick per un canale IRC | puntatore al nick (opzionale) | server,channel,nick (nick is optional) diff --git a/doc/ja/autogen/plugin_api/infolists.asciidoc b/doc/ja/autogen/plugin_api/infolists.asciidoc index 32178de2d..c67d6d241 100644 --- a/doc/ja/autogen/plugin_api/infolists.asciidoc +++ b/doc/ja/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | IRC サーバのチャンネルリスト | チャンネルポインタ (任意) | server,channel (チャンネルは任意) +| irc | irc_color_weechat | mapping between IRC color codes and WeeChat color names | - | - + | irc | irc_ignore | IRC 無視のリスト | 無視ポインタ (任意) | - | irc | irc_nick | IRC チャンネルのニックネームのリスト | ニックネームポインタ (任意) | サーバ、チャンネル、ニックネーム (ニックネームは任意) diff --git a/doc/pl/autogen/plugin_api/infolists.asciidoc b/doc/pl/autogen/plugin_api/infolists.asciidoc index 842398a2d..7e0289e3b 100644 --- a/doc/pl/autogen/plugin_api/infolists.asciidoc +++ b/doc/pl/autogen/plugin_api/infolists.asciidoc @@ -8,6 +8,8 @@ | irc | irc_channel | lista kanałów IRC | wskaźnik kanału (opcjonalne) | serwer,kanał (kanał jest opcjonalny) +| irc | irc_color_weechat | mapping between IRC color codes and WeeChat color names | - | - + | irc | irc_ignore | lista ignorów IRC | wskaźnik ignorowania (opcjonalne) | - | irc | irc_nick | lista nicków na kanale IRC | wskaźnik nicka (opcjonalne) | serwer,kanał,nick (nick jest opcjonalny) diff --git a/po/cs.po b/po/cs.po index 40fa40ddd..ad8473612 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -114,6 +114,14 @@ msgstr "" msgid "Constants" msgstr "" +#, fuzzy +msgid "IRC color" +msgstr "barva" + +#, fuzzy +msgid "WeeChat color" +msgstr "Základní barvy WeeChat:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -7458,6 +7466,9 @@ msgstr "seznam notifikací" msgid "notify pointer (optional)" msgstr "ukazatel notifikace (volitelné)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + #, fuzzy msgid "irc nick" msgstr "přezdívka: přezdívka" diff --git a/po/de.po b/po/de.po index e42cc77e0..e2a8d98a6 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -116,6 +116,14 @@ msgstr "Type" msgid "Constants" msgstr "Konstanten" +#, fuzzy +msgid "IRC color" +msgstr "Farbe" + +#, fuzzy +msgid "WeeChat color" +msgstr "WeeChat Basisfarben:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -8573,6 +8581,9 @@ msgstr "Liste mit Benachrichtigungen" msgid "notify pointer (optional)" msgstr "Benachrichtigungspointer (optional)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "IRC-Nick" diff --git a/po/es.po b/po/es.po index 444c3cac1..580621194 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -116,6 +116,14 @@ msgstr "Tipo" msgid "Constants" msgstr "Constantes" +#, fuzzy +msgid "IRC color" +msgstr "color" + +#, fuzzy +msgid "WeeChat color" +msgstr "Colores básicos de WeeChat:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -7758,6 +7766,9 @@ msgstr "lista de notificaciones" msgid "notify pointer (optional)" msgstr "puntero de la notificación (opcional)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "apodo irc" diff --git a/po/fr.po b/po/fr.po index b735c09c3..3d6b121be 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: 2014-11-09 17:33+0100\n" -"PO-Revision-Date: 2014-11-09 17:34+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" +"PO-Revision-Date: 2014-11-11 10:03+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -112,6 +112,12 @@ msgstr "Type" msgid "Constants" msgstr "Constantes" +msgid "IRC color" +msgstr "Couleur IRC" + +msgid "WeeChat color" +msgstr "Couleur WeeChat" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -8359,6 +8365,10 @@ msgstr "liste des notifications" msgid "notify pointer (optional)" msgstr "pointeur vers la notification (optionnel)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" +"correspondance entre les codes couleur IRC et les noms de couleur WeeChat" + msgid "irc nick" msgstr "pseudo irc" diff --git a/po/hu.po b/po/hu.po index 1731e247f..d5fa7500e 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -118,6 +118,14 @@ msgstr "" msgid "Constants" msgstr "" +#, fuzzy +msgid "IRC color" +msgstr "üzenetek színe" + +#, fuzzy +msgid "WeeChat color" +msgstr "WeeChat Hiba:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, fuzzy, c-format msgid "" @@ -6912,6 +6920,9 @@ msgstr "konfigurációs paraméterek beállítása" msgid "notify pointer (optional)" msgstr "Beállítások mentése a lemezre\n" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + #, fuzzy msgid "irc nick" msgstr "név: név" diff --git a/po/it.po b/po/it.po index 7b877f81f..1a6e58a05 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -114,6 +114,14 @@ msgstr "Tipo" msgid "Constants" msgstr "Costanti" +#, fuzzy +msgid "IRC color" +msgstr "colore" + +#, fuzzy +msgid "WeeChat color" +msgstr "Colori base di WeeChat:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -7915,6 +7923,9 @@ msgstr "elenco delle notifiche" msgid "notify pointer (optional)" msgstr "puntatore alla notifica (opzionale)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "nick irc" diff --git a/po/ja.po b/po/ja.po index 283677be1..13d23b318 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-10 06:29+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -40,11 +40,11 @@ msgid "max chars" msgstr "最大文字数" msgid "" -"a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)" -"green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal " -"color number or an alias; attributes are allowed before color (for text " -"color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" for " -"italic, \"_\" for underline" +"a WeeChat color name (default, black, (dark)gray, white, (light)red, " +"(light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a " +"terminal color number or an alias; attributes are allowed before color (for " +"text color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" " +"for italic, \"_\" for underline" msgstr "" "WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、" "brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号ま" @@ -109,6 +109,14 @@ msgstr "タイプ" msgid "Constants" msgstr "定数" +#, fuzzy +msgid "IRC color" +msgstr "色" + +#, fuzzy +msgid "WeeChat color" +msgstr "WeeChat 基本色:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -5946,8 +5954,8 @@ msgstr "" " - 内部サーバ名 (/server add で作成されたもの、利用推奨)\n" " - ホスト名/ポート番号又は IP アドレス/ポート番号、デフォルトの" "ポート番号は 6667\n" -" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:password]@]" -"irc.example.org[:port][/#channel1][,#channel2[...]]\n" +" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:" +"password]@]irc.example.org[:port][/#channel1][,#channel2[...]]\n" " 注意: アドレス/IP/URL を指定した場合、サーバを一時的に作ります " "(保存しません)、/help irc.look.temporary_servers を参照してください。\n" " option: サーバに関するオプション (ブール型オプションでは、value は無視さ" @@ -8019,6 +8027,9 @@ msgstr "通知のリスト" msgid "notify pointer (optional)" msgstr "通知ポインタ (任意)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "irc ニックネーム" @@ -10894,8 +10905,8 @@ msgid "" "Examples (you can also look at default triggers with /trigger listdefault):\n" " add text attributes *bold*, _underline_ and /italic/ (only in user " "messages):\n" -" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*" -"(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" "underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" "italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" @@ -10971,8 +10982,8 @@ msgstr "" "\n" "例 (/trigger listdefault でデフォルトトリガを見ることができます):\n" " テキスト属性 *太字*、_下線_、/イタリック/ を追加 (ユーザメッセージのみ):\n" -" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*" -"(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" "underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" "italic}${re:1}${color:-italic}/\"\n" " 狭い端末ではニックネームリストバーを隠す:\n" diff --git a/po/pl.po b/po/pl.po index a42b67795..1f8d5567b 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -113,6 +113,14 @@ msgstr "Typ" msgid "Constants" msgstr "Stałe" +#, fuzzy +msgid "IRC color" +msgstr "kolor" + +#, fuzzy +msgid "WeeChat color" +msgstr "Podstawowe kolory WeeChat:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -8186,6 +8194,9 @@ msgstr "lista powiadomień" msgid "notify pointer (optional)" msgstr "wskaźnik powiadomienia (opcjonalne)" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "nazwa użytkownika irc" diff --git a/po/pt_BR.po b/po/pt_BR.po index 92d2d0bfe..38ed90660 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -120,6 +120,14 @@ msgstr "" msgid "Constants" msgstr "" +#, fuzzy +msgid "IRC color" +msgstr "cor" + +#, fuzzy +msgid "WeeChat color" +msgstr "Cores básicas do WeeChat:" + # Common conventions used here: # hotlist -> lista de atividade # input -> entrada @@ -7172,6 +7180,9 @@ msgstr "" msgid "notify pointer (optional)" msgstr "" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "apelido irc" diff --git a/po/ru.po b/po/ru.po index cd961fb49..93babd85a 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -126,6 +126,14 @@ msgstr "" msgid "Constants" msgstr "" +#, fuzzy +msgid "IRC color" +msgstr "цвет чата" + +#, fuzzy +msgid "WeeChat color" +msgstr "Ошибка WeeChat:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, fuzzy, c-format msgid "" @@ -6940,6 +6948,9 @@ msgstr "настроить параметры конфигурации" msgid "notify pointer (optional)" msgstr "Сохраняю конфигурацию\n" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + #, fuzzy msgid "irc nick" msgstr "ник: ник" diff --git a/po/tr.po b/po/tr.po index 6f6501479..3fbde20e6 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -106,6 +106,14 @@ msgstr "Tür" msgid "Constants" msgstr "" +#, fuzzy +msgid "IRC color" +msgstr "renk" + +#, fuzzy +msgid "WeeChat color" +msgstr "Weechat temel renkler:" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -6186,6 +6194,9 @@ msgstr "" msgid "notify pointer (optional)" msgstr "" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "irc rumuz" diff --git a/po/weechat.pot b/po/weechat.pot index ecded5aad..951a2d96b 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: 2014-11-09 17:33+0100\n" +"POT-Creation-Date: 2014-11-11 10:02+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -105,6 +105,12 @@ msgstr "" msgid "Constants" msgstr "" +msgid "IRC color" +msgstr "" + +msgid "WeeChat color" +msgstr "" + #. TRANSLATORS: "%s %s" after "compiled on" is date and time #, c-format msgid "" @@ -6121,6 +6127,9 @@ msgstr "" msgid "notify pointer (optional)" msgstr "" +msgid "mapping between IRC color codes and WeeChat color names" +msgstr "" + msgid "irc nick" msgstr "" diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 63cac5b73..c603a0f1a 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -805,6 +805,40 @@ irc_color_for_tags (const char *color) return weechat_string_replace (color, ",", ":"); } +/* + * Adds mapping between IRC color codes and WeeChat color names in an infolist. + * + * Returns: + * 1: OK + * 0: error + */ + +int +irc_color_weechat_add_to_infolist (struct t_infolist *infolist) +{ + struct t_infolist_item *ptr_item; + char str_color_irc[32]; + int i; + + if (!infolist) + return 0; + + for (i = 0; i < IRC_NUM_COLORS; i++) + { + ptr_item = weechat_infolist_new_item (infolist); + if (!ptr_item) + return 0; + + snprintf (str_color_irc, sizeof (str_color_irc), "%02d", i); + if (!weechat_infolist_new_var_string (ptr_item, "color_irc", str_color_irc)) + return 0; + if (!weechat_infolist_new_var_string (ptr_item, "color_weechat", irc_color_to_weechat[i])) + return 0; + } + + return 1; +} + /* * Ends IRC colors. */ diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index c1d2c8f78..a89569b15 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -109,6 +109,7 @@ extern char *irc_color_modifier_cb (void *data, const char *modifier, const char *modifier_data, const char *string); extern char *irc_color_for_tags (const char *color); +extern int irc_color_weechat_add_to_infolist (struct t_infolist *infolist); extern void irc_color_end (); #endif /* WEECHAT_IRC_COLOR_H */ diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index 0abc1f788..83ec5be01 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -26,6 +26,7 @@ #include "../weechat-plugin.h" #include "irc.h" #include "irc-channel.h" +#include "irc-color.h" #include "irc-config.h" #include "irc-ignore.h" #include "irc-message.h" @@ -563,6 +564,20 @@ irc_info_get_infolist_cb (void *data, const char *infolist_name, } } } + else if (weechat_strcasecmp (infolist_name, "irc_color_weechat") == 0) + { + ptr_infolist = weechat_infolist_new (); + if (ptr_infolist) + { + /* build list with all IRC colors */ + if (!irc_color_weechat_add_to_infolist (ptr_infolist)) + { + weechat_infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + } return NULL; } @@ -658,6 +673,11 @@ irc_info_init () N_("notify pointer (optional)"), N_("server name (wildcard \"*\" is allowed) (optional)"), &irc_info_get_infolist_cb, NULL); + weechat_hook_infolist ("irc_color_weechat", + N_("mapping between IRC color codes and WeeChat color names"), + NULL, + NULL, + &irc_info_get_infolist_cb, NULL); /* hdata hooks */ weechat_hook_hdata ("irc_nick", N_("irc nick"),