mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 15:26:37 +02:00
Add IRC info "irc_nick_color_name" to get color name of a nick
This commit is contained in:
@@ -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`)
|
||||
|
||||
|
||||
@@ -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`)
|
||||
|
||||
|
||||
@@ -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`)
|
||||
|
||||
|
||||
@@ -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`)
|
||||
|
||||
|
||||
@@ -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 <golemj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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
|
||||
|
||||
@@ -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 <marcopaolone@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <bartek@stobiecki.eu>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
|
||||
|
||||
@@ -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 <stlwrt@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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
|
||||
|
||||
+5
-2
@@ -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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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"
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user