diff --git a/doc/de/autogen/plugin_api/infos.txt b/doc/de/autogen/plugin_api/infos.txt index e71a57c32..0f13b6cfd 100644 --- a/doc/de/autogen/plugin_api/infos.txt +++ b/doc/de/autogen/plugin_api/infos.txt @@ -12,7 +12,9 @@ | irc | irc_nick | Aktuellen Nicknamen für den Server erhalten | Servername -| irc | irc_nick_color | Hole Farbe für Nick | Nickname +| irc | irc_nick_color | get nick color code | Nickname + +| irc | irc_nick_color_name | get nick color name | Nickname | irc | irc_nick_from_host | Nicknamen des IRC-Hosts erhalten | IRC host (in der Form `:nick!name@server.com`) diff --git a/doc/en/autogen/plugin_api/infos.txt b/doc/en/autogen/plugin_api/infos.txt index 815d746b5..9de4fb5c6 100644 --- a/doc/en/autogen/plugin_api/infos.txt +++ b/doc/en/autogen/plugin_api/infos.txt @@ -12,7 +12,9 @@ | irc | irc_nick | get current nick on a server | server name -| irc | irc_nick_color | get nick color | nickname +| irc | irc_nick_color | get nick color code | nickname + +| irc | irc_nick_color_name | get nick color name | nickname | irc | irc_nick_from_host | get nick from IRC host | IRC host (like `:nick!name@server.com`) diff --git a/doc/fr/autogen/plugin_api/infos.txt b/doc/fr/autogen/plugin_api/infos.txt index 9267ae291..4c16c9100 100644 --- a/doc/fr/autogen/plugin_api/infos.txt +++ b/doc/fr/autogen/plugin_api/infos.txt @@ -12,7 +12,9 @@ | irc | irc_nick | retourne le pseudo utilisé actuellement sur un serveur | nom de serveur -| irc | irc_nick_color | retourne la couleur du pseudo | pseudo +| irc | irc_nick_color | retourne le code couleur du pseudo | pseudo + +| irc | irc_nick_color_name | retourne le nom de la couleur du pseudo | pseudo | irc | irc_nick_from_host | retourne le pseudo à partir d'un host IRC | host IRC (comme `:pseudo!nom@serveur.com`) diff --git a/doc/it/autogen/plugin_api/infos.txt b/doc/it/autogen/plugin_api/infos.txt index 603d642b0..71a886680 100644 --- a/doc/it/autogen/plugin_api/infos.txt +++ b/doc/it/autogen/plugin_api/infos.txt @@ -12,7 +12,9 @@ | irc | irc_nick | ottiene nick corrente su un server | nome server -| irc | irc_nick_color | riceve colore del nick | nick +| irc | irc_nick_color | get nick color code | nick + +| irc | irc_nick_color_name | get nick color name | nick | irc | irc_nick_from_host | ottiene nick dall'host IRC | host IRC (come `:nick!nome@server.com`) diff --git a/po/cs.po b/po/cs.po index 02e3e6a32..977100e87 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-06-08 14:17+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -4726,7 +4726,12 @@ msgstr "získat přezdívku od IRC hosta" msgid "IRC host (like `:nick!name@server.com`)" msgstr "IRC host (jako `:nick!name@server.com`)" -msgid "get nick color" +#, fuzzy +msgid "get nick color code" +msgstr "získat barvu barva přezdívky" + +#, fuzzy +msgid "get nick color name" msgstr "získat barvu barva přezdívky" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/po/de.po b/po/de.po index 151b5a524..34b658f8e 100644 --- a/po/de.po +++ b/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-06-10 09:46+0200\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev \n" @@ -4922,7 +4922,12 @@ msgstr "Nicknamen des IRC-Hosts erhalten" msgid "IRC host (like `:nick!name@server.com`)" msgstr "IRC host (in der Form `:nick!name@server.com`)" -msgid "get nick color" +#, fuzzy +msgid "get nick color code" +msgstr "Hole Farbe für Nick" + +#, fuzzy +msgid "get nick color name" msgstr "Hole Farbe für Nick" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/po/es.po b/po/es.po index 3d083714c..1ffce854c 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-06-08 14:19+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -4795,7 +4795,12 @@ msgstr "devuelve apodo de un host IRC" msgid "IRC host (like `:nick!name@server.com`)" msgstr "IRC host (como `:apodo!nombre@servidor.com`)" -msgid "get nick color" +#, fuzzy +msgid "get nick color code" +msgstr "obtiene el color del apodo" + +#, fuzzy +msgid "get nick color name" msgstr "obtiene el color del apodo" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/po/fr.po b/po/fr.po index 66dd6b754..26816f286 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" -"PO-Revision-Date: 2010-06-10 11:34+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" +"PO-Revision-Date: 2010-06-15 13:26+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -4838,8 +4838,11 @@ msgstr "retourne le pseudo à partir d'un host IRC" msgid "IRC host (like `:nick!name@server.com`)" msgstr "host IRC (comme `:pseudo!nom@serveur.com`)" -msgid "get nick color" -msgstr "retourne la couleur du pseudo" +msgid "get nick color code" +msgstr "retourne le code couleur du pseudo" + +msgid "get nick color name" +msgstr "retourne le nom de la couleur du pseudo" msgid "get buffer pointer for an IRC server/channel/nick" msgstr "retourne le pointeur vers le tampon pour un serveur/canal/pseudo IRC" diff --git a/po/hu.po b/po/hu.po index 9c23d70d1..3cbf0785f 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-05-20 12:20+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4540,7 +4540,11 @@ msgid "IRC host (like `:nick!name@server.com`)" msgstr "" #, fuzzy -msgid "get nick color" +msgid "get nick color code" +msgstr "üzenetek színe" + +#, fuzzy +msgid "get nick color name" msgstr "üzenetek színe" #, fuzzy diff --git a/po/it.po b/po/it.po index 602a9a25f..4c3ecfe21 100644 --- a/po/it.po +++ b/po/it.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Weechat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-14 09:57+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-06-10 17:36+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -4811,7 +4811,12 @@ msgstr "ottiene nick dall'host IRC" msgid "IRC host (like `:nick!name@server.com`)" msgstr "host IRC (come `:nick!nome@server.com`)" -msgid "get nick color" +#, fuzzy +msgid "get nick color code" +msgstr "riceve colore del nick" + +#, fuzzy +msgid "get nick color name" msgstr "riceve colore del nick" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/po/pl.po b/po/pl.po index bf5b056d1..5c73da235 100644 --- a/po/pl.po +++ b/po/pl.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-13 11:24+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-06-13 10:51+0100\n" "Last-Translator: B.J. Stobiecki \n" "Language-Team: weechat-dev \n" @@ -4777,7 +4777,12 @@ msgstr "pobiera nick z hosta IRC" msgid "IRC host (like `:nick!name@server.com`)" msgstr "host IRC (jak `:nick!nazwa@serwer.com`)" -msgid "get nick color" +#, fuzzy +msgid "get nick color code" +msgstr "pobiera kolor nicka" + +#, fuzzy +msgid "get nick color name" msgstr "pobiera kolor nicka" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/po/ru.po b/po/ru.po index 3e46c3d80..76a9f9cb4 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: 2010-05-20 12:22+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -4541,7 +4541,11 @@ msgid "IRC host (like `:nick!name@server.com`)" msgstr "" #, fuzzy -msgid "get nick color" +msgid "get nick color code" +msgstr "цвет чата" + +#, fuzzy +msgid "get nick color name" msgstr "цвет чата" #, fuzzy diff --git a/po/weechat.pot b/po/weechat.pot index 33646a126..5956d99ad 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-06-10 12:39+0200\n" +"POT-Creation-Date: 2010-06-15 13:26+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3888,7 +3888,10 @@ msgstr "" msgid "IRC host (like `:nick!name@server.com`)" msgstr "" -msgid "get nick color" +msgid "get nick color code" +msgstr "" + +msgid "get nick color name" msgstr "" msgid "get buffer pointer for an IRC server/channel/nick" diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index 0e437a37b..6ad2dc584 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -102,6 +102,10 @@ irc_info_get_info_cb (void *data, const char *info_name, { return irc_nick_find_color (arguments); } + else if (weechat_strcasecmp (info_name, "irc_nick_color_name") == 0) + { + return irc_nick_find_color_name (arguments); + } else if (weechat_strcasecmp (info_name, "irc_buffer") == 0) { if (arguments && arguments[0]) @@ -456,7 +460,10 @@ irc_info_init () weechat_hook_info ("irc_nick_from_host", N_("get nick from IRC host"), N_("IRC host (like `:nick!name@server.com`)"), &irc_info_get_info_cb, NULL); - weechat_hook_info ("irc_nick_color", N_("get nick color"), + weechat_hook_info ("irc_nick_color", N_("get nick color code"), + N_("nickname"), + &irc_info_get_info_cb, NULL); + weechat_hook_info ("irc_nick_color_name", N_("get nick color name"), N_("nickname"), &irc_info_get_info_cb, NULL); weechat_hook_info ("irc_buffer", N_("get buffer pointer for an IRC server/channel/nick"), diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 5c474440a..9ea273910 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -90,7 +90,8 @@ irc_nick_is_nick (const char *string) } /* - * irc_nick_find_color: find a color for a nick (according to nick letters) + * irc_nick_find_color: find a color code for a nick + * (according to nick letters) */ const char * @@ -116,6 +117,34 @@ irc_nick_find_color (const char *nickname) return weechat_color (color_name); } +/* + * irc_nick_find_color_name: find a color name for a nick + * (according to nick letters) + */ + +const char * +irc_nick_find_color_name (const char *nickname) +{ + int color; + char color_name[128]; + const char *ptr_nick; + + color = 0; + ptr_nick = nickname; + while (ptr_nick && ptr_nick[0]) + { + color += weechat_utf8_char_int (ptr_nick); + ptr_nick = weechat_utf8_next_char (ptr_nick); + } + color = (color % + weechat_config_integer (weechat_config_get ("weechat.look.color_nicks_number"))); + + snprintf (color_name, sizeof (color_name), + "weechat.color.chat_nick_color%02d", color + 1); + + return weechat_config_color (weechat_config_get (color_name)); +} + /* * irc_nick_get_gui_infos: get GUI infos for a nick (sort_index, prefix, * prefix color) diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h index 12773dd19..43334207b 100644 --- a/src/plugins/irc/irc-nick.h +++ b/src/plugins/irc/irc-nick.h @@ -70,6 +70,7 @@ extern int irc_nick_valid (struct t_irc_channel *channel, struct t_irc_nick *nick); extern int irc_nick_is_nick (const char *string); extern const char *irc_nick_find_color (const char *nickname); +extern const char *irc_nick_find_color_name (const char *nickname); extern void irc_nick_get_gui_infos (struct t_irc_server *server, struct t_irc_nick *nick, char *prefix, int *prefix_color,