From 9cbcc24d4c19c6a37b0f0c7948955ec4f0cd73be Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 20 Apr 2010 22:19:43 +0200 Subject: [PATCH] Add new option irc.color.item_buffer_name_ssl (task #10339) --- ChangeLog | 2 ++ doc/en/autogen/user/irc_options.txt | 5 +++++ doc/fr/autogen/user/irc_options.txt | 5 +++++ doc/it/autogen/user/irc_options.txt | 5 +++++ po/cs.po | 11 +++++++++- po/de.po | 10 ++++++++- po/es.po | 10 ++++++++- po/fr.po | 14 +++++++++++-- po/hu.po | 10 ++++++++- po/it.po | 10 ++++++++- po/pl.po | 10 ++++++++- po/ru.po | 10 ++++++++- po/weechat.pot | 9 +++++++- src/plugins/irc/irc-bar-item.c | 8 ++++---- src/plugins/irc/irc-color.h | 32 +++++++++++++++++++++++++++++ src/plugins/irc/irc-config.c | 17 ++++++++++----- src/plugins/irc/irc-config.h | 1 + src/plugins/irc/irc-display.c | 1 + src/plugins/irc/irc-nick.c | 1 + src/plugins/irc/irc.h | 29 -------------------------- 20 files changed, 152 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6901ddc9c..7a39c0404 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ v0.3.3-dev, 2010-04-20 Version 0.3.3 (under dev!) -------------------------- + +* irc: add new option irc.color.item_buffer_name_ssl (task #10339) * irc: try other nick when connecting to server and receiving message 437 (nick unavailable) * irc: set buffer local variable "away" when opening new channel (bug #29618) diff --git a/doc/en/autogen/user/irc_options.txt b/doc/en/autogen/user/irc_options.txt index 4dfadd4bc..c848346ac 100644 --- a/doc/en/autogen/user/irc_options.txt +++ b/doc/en/autogen/user/irc_options.txt @@ -8,6 +8,11 @@ ** type: color ** values: a color name (default value: yellow) +* *irc.color.item_buffer_name_ssl* +** description: color for buffer name when connected using SSL to server +** type: color +** values: a color name (default value: lightgreen) + * *irc.color.item_channel_modes* ** description: color for channel modes, near channel name ** type: color diff --git a/doc/fr/autogen/user/irc_options.txt b/doc/fr/autogen/user/irc_options.txt index 3903da06a..e074f273b 100644 --- a/doc/fr/autogen/user/irc_options.txt +++ b/doc/fr/autogen/user/irc_options.txt @@ -8,6 +8,11 @@ ** type: couleur ** valeurs: un nom de couleur (valeur par défaut: yellow) +* *irc.color.item_buffer_name_ssl* +** description: couleur pour le nom du tampon lorsque la connexion au serveur utilise SSL +** type: couleur +** valeurs: un nom de couleur (valeur par défaut: lightgreen) + * *irc.color.item_channel_modes* ** description: couleur pour les modes du canal, à côté du nom du canal ** type: couleur diff --git a/doc/it/autogen/user/irc_options.txt b/doc/it/autogen/user/irc_options.txt index 9cd7e65f2..ddbe1522e 100644 --- a/doc/it/autogen/user/irc_options.txt +++ b/doc/it/autogen/user/irc_options.txt @@ -8,6 +8,11 @@ ** tipo: colore ** valori: un nome colore (valore predefinito: yellow) +* *irc.color.item_buffer_name_ssl* +** descrizione: color for buffer name when connected using SSL to server +** tipo: colore +** valori: un nome colore (valore predefinito: lightgreen) + * *irc.color.item_channel_modes* ** descrizione: colore per le modalità dei canali, vicino ai nomi dei canali ** tipo: colore diff --git a/po/cs.po b/po/cs.po index e114e21b7..74dbde3e0 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:50+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -4489,6 +4489,10 @@ msgstr "barva položek, které jsou pryč" msgid "color for channel modes, near channel name" msgstr "barva módů kanálu, blízko jména kanálu" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s%s: nejste připojen k serveru" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -4986,6 +4990,11 @@ msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" "%s: přezdívka \"%s\" je již používaná, zkouším přezdívku číslo %d (\"%s\")" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "" +"%s%s: přezdívka \"%s\" je nevalidní, zkouším přezdívku číslo %d (\"%s\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: příkaz \"%s\" nenalezen:" diff --git a/po/de.po b/po/de.po index 80fcf1b2c..9a1e2350c 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:50+0200\n" "Last-Translator: Nils G \n" "Language-Team: weechat-dev \n" @@ -4660,6 +4660,10 @@ msgstr "Farbe des Abwesenheit-Textes in der Eingabezeile" msgid "color for channel modes, near channel name" msgstr "Farbe der Channel-Modes (neben dem Channelnamen)" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s%s: Es besteht keine Verbindung zum Server" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -5156,6 +5160,10 @@ msgstr "" "%s: Der Nickname \"%s\" wird bereits verwendet. Versuche nun #%d (\"%s\") " "als neuen Nicknamen zu nutzen" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s%s: Nickname \"%s\" ist ungültig, versuche Nickname #%d (\"%s\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: Befehl \"%s\" nicht gefunden:" diff --git a/po/es.po b/po/es.po index 9c8cc26a4..1acd466e0 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:50+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -4556,6 +4556,10 @@ msgstr "color para el texto \"ausente\" en al barra de entrada" msgid "color for channel modes, near channel name" msgstr "color para los modos del canal, junto al nombre del canal" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s%s: no estas conectado a ningún servidor" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -5049,6 +5053,10 @@ msgstr "" msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: el apodo \"%s\" ya está en uso, probando con apodo #%d (\"%s\")" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s%s: el apodo \"%s\" es inválido, probando con apodo #%d (\"%s\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: comando \"%s\" no encontrado:" diff --git a/po/fr.po b/po/fr.po index c3823bc79..489bddbf8 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-04-18 15:13+0200\n" -"PO-Revision-Date: 2010-04-18 15:18+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" +"PO-Revision-Date: 2010-04-20 22:03+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -4590,6 +4590,10 @@ msgstr "couleur pour l'objet away" msgid "color for channel modes, near channel name" msgstr "couleur pour les modes du canal, à côté du nom du canal" +msgid "color for buffer name when connected using SSL to server" +msgstr "" +"couleur pour le nom du tampon lorsque la connexion au serveur utilise SSL" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -5084,6 +5088,12 @@ msgstr "" "%s: le pseudo \"%s\" est déjà en cours d'utilisation, essai avec le pseudo n°" "%d (\"%s\")" +#, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "" +"%s%s: le pseudo \"%s\" n'est pas disponible, essai avec le pseudo n°%d (\"%s" +"\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: commande \"%s\" non trouvée:" diff --git a/po/hu.po b/po/hu.po index 4556e4ad9..a5d7c555e 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4307,6 +4307,10 @@ msgstr "távollevő felhasználók nevének színe" msgid "color for channel modes, near channel name" msgstr "szobanevek színe az eseményekben" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s nincs csatlakozva szerverhez!\n" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -4801,6 +4805,10 @@ msgstr "%s: minden megadott név foglalt, kapcsolat bontása a szerverrel!\n" msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: a(z) \"%s\" név már foglalt, próbálom a második nevet: \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s: a(z) \"%s\" név már foglalt, próbálom a második nevet: \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s a \"%s\" modul nem található\n" diff --git a/po/it.po b/po/it.po index deab4a719..8f532bf14 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:51+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -4563,6 +4563,10 @@ msgstr "colore per l'elemento assenza" msgid "color for channel modes, near channel name" msgstr "colore per le modalità dei canali, vicino ai nomi dei canali" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s%s: non connesso al server" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -5053,6 +5057,10 @@ msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" "%s: il nick \"%s\" è già utilizzato, tentativo con il nick #%d (\"%s\")" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s%s: il nick \"%s\" è invalido, tentativo con il nick #%d (\"%s\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: comando \"%s\" non trovato:" diff --git a/po/pl.po b/po/pl.po index d82327e2a..4e8805b6b 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2010-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:51+0200\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: Polish\n" @@ -4534,6 +4534,10 @@ msgstr "kolor elementu nieobecności" msgid "color for channel modes, near channel name" msgstr "kolor trybów kanału, przy nazwie kanału" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s%s: nie jesteś połączony z serwerem" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -5033,6 +5037,10 @@ msgstr "" msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: nick \"%s\" jest już używany, próbuje nick #%d (\"%s\")" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s%s: nick \"%s\" jest nieprawidłowy, próbuje nicku #%d (\"%s\")" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: nie znaleziono komendy \"%s\":" diff --git a/po/ru.po b/po/ru.po index 09d38ab84..13629359c 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: 2010-04-18 10:51+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -4308,6 +4308,10 @@ msgstr "цвет отошедших ников" msgid "color for channel modes, near channel name" msgstr "цвет имён при действиях" +#, fuzzy +msgid "color for buffer name when connected using SSL to server" +msgstr "%s вы не подключены к серверу\n" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -4809,6 +4813,10 @@ msgstr "%s: все предложенные ники заняты, отключ msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "%s: ник \"%s\" уже используется, пробую второй ник \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "%s: ник \"%s\" уже используется, пробую второй ник \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s plugin \"%s\" не найден\n" diff --git a/po/weechat.pot b/po/weechat.pot index b44d154c7..18916dfd0 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-04-18 15:13+0200\n" +"POT-Creation-Date: 2010-04-20 22:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3685,6 +3685,9 @@ msgstr "" msgid "color for channel modes, near channel name" msgstr "" +msgid "color for buffer name when connected using SSL to server" +msgstr "" + msgid "" "timeout (in seconds) between TCP connection to server and message 001 " "received, if this timeout is reached before 001 message is received, WeeChat " @@ -4138,6 +4141,10 @@ msgstr "" msgid "%s: nickname \"%s\" is already in use, trying nickname #%d (\"%s\")" msgstr "" +#, c-format +msgid "%s%s: nickname \"%s\" is unavailable, trying nickname #%d (\"%s\")" +msgstr "" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "" diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 647973617..c791e674a 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -206,7 +206,7 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, snprintf (buf_name, sizeof (buf_name), "%s%s[%s%s%s]", _("server"), IRC_COLOR_BAR_DELIM, - IRC_COLOR_STATUS_NAME, + (server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME, server->name, IRC_COLOR_BAR_DELIM); } @@ -220,11 +220,11 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, "%s%s%s%s%s%s%s%s%s%s", (part_from_channel) ? IRC_COLOR_BAR_DELIM : "", (part_from_channel) ? "(" : "", - IRC_COLOR_STATUS_NAME, + (server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME, (display_server) ? server->name : "", (display_server) ? IRC_COLOR_BAR_DELIM : "", (display_server) ? "/" : "", - IRC_COLOR_STATUS_NAME, + (server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME, channel->name, (part_from_channel) ? IRC_COLOR_BAR_DELIM : "", (part_from_channel) ? ")" : ""); @@ -267,7 +267,7 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, } snprintf (buf, sizeof (buf), "%s%s%s", - IRC_COLOR_STATUS_NAME, + (server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME, buf_name, modes); return strdup (buf); diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index bf81f820a..6e32b9f25 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -55,6 +55,38 @@ #define IRC_COLOR_UNDERLINE_CHAR '\x1F' #define IRC_COLOR_UNDERLINE_STR "\x1F" +/* macros for WeeChat core and IRC colors */ + +#define IRC_COLOR_CHAT weechat_color("chat") +#define IRC_COLOR_CHAT_CHANNEL weechat_color("chat_channel") +#define IRC_COLOR_CHAT_DELIMITERS weechat_color("chat_delimiters") +#define IRC_COLOR_CHAT_HOST weechat_color("chat_host") +#define IRC_COLOR_CHAT_NICK weechat_color("chat_nick") +#define IRC_COLOR_CHAT_NICK_SELF weechat_color("chat_nick_self") +#define IRC_COLOR_CHAT_NICK_OTHER weechat_color("chat_nick_other") +#define IRC_COLOR_CHAT_SERVER weechat_color("chat_server") +#define IRC_COLOR_CHAT_VALUE weechat_color("chat_value") +#define IRC_COLOR_NICKLIST_PREFIX1 weechat_color("nicklist_prefix1") +#define IRC_COLOR_NICKLIST_PREFIX2 weechat_color("nicklist_prefix2") +#define IRC_COLOR_NICKLIST_PREFIX3 weechat_color("nicklist_prefix3") +#define IRC_COLOR_NICKLIST_PREFIX4 weechat_color("nicklist_prefix4") +#define IRC_COLOR_NICKLIST_PREFIX5 weechat_color("nicklist_prefix5") +#define IRC_COLOR_BAR_FG weechat_color("bar_fg") +#define IRC_COLOR_BAR_BG weechat_color("bar_bg") +#define IRC_COLOR_BAR_DELIM weechat_color("bar_delim") +#define IRC_COLOR_STATUS_NUMBER weechat_color(weechat_config_string(weechat_config_get("weechat.color.status_number"))) +#define IRC_COLOR_STATUS_NAME weechat_color(weechat_config_string(weechat_config_get("weechat.color.status_name"))) +#define IRC_COLOR_STATUS_NAME_SSL weechat_color(weechat_config_string(irc_config_color_item_buffer_name_ssl)) +#define IRC_COLOR_MESSAGE_JOIN weechat_color(weechat_config_string(irc_config_color_message_join)) +#define IRC_COLOR_MESSAGE_QUIT weechat_color(weechat_config_string(irc_config_color_message_quit)) +#define IRC_COLOR_NOTICE weechat_color(weechat_config_string(irc_config_color_notice)) +#define IRC_COLOR_INPUT_NICK weechat_color(weechat_config_string(irc_config_color_input_nick)) +#define IRC_COLOR_ITEM_AWAY weechat_color(weechat_config_string(irc_config_color_item_away)) +#define IRC_COLOR_ITEM_CHANNEL_MODES weechat_color(weechat_config_string(irc_config_color_item_channel_modes)) +#define IRC_COLOR_NICK_IN_SERVER_MESSAGE(nick) \ + ((nick && weechat_config_boolean(irc_config_look_color_nicks_in_server_messages)) ? \ + nick->color : IRC_COLOR_CHAT_NICK) + extern char *irc_color_decode (const char *string, int keep_colors); extern char *irc_color_decode_for_user_entry (const char *string); extern char *irc_color_encode (const char *string, int keep_colors); diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index ab3e7e01d..b7c1d3d7d 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -87,6 +87,7 @@ struct t_config_option *irc_config_color_notice; struct t_config_option *irc_config_color_input_nick; struct t_config_option *irc_config_color_item_away; struct t_config_option *irc_config_color_item_channel_modes; +struct t_config_option *irc_config_color_item_buffer_name_ssl; /* IRC config, network section */ @@ -389,13 +390,13 @@ irc_config_change_color_item_away (void *data, } /* - * irc_config_change_color_item_channel_modes: called when the color of channel - * modes is changed + * irc_config_change_color_item_buffer_name: called when the color of buffer + * name is changed */ void -irc_config_change_color_item_channel_modes (void *data, - struct t_config_option *option) +irc_config_change_color_item_buffer_name (void *data, + struct t_config_option *option) { /* make C compiler happy */ (void) data; @@ -1634,7 +1635,13 @@ irc_config_init () "item_channel_modes", "color", N_("color for channel modes, near channel name"), NULL, -1, 0, "default", NULL, 0, NULL, NULL, - &irc_config_change_color_item_channel_modes, NULL, NULL, NULL); + &irc_config_change_color_item_buffer_name, NULL, NULL, NULL); + irc_config_color_item_buffer_name_ssl = weechat_config_new_option ( + irc_config_file, ptr_section, + "item_buffer_name_ssl", "color", + N_("color for buffer name when connected using SSL to server"), + NULL, -1, 0, "lightgreen", NULL, 0, NULL, NULL, + &irc_config_change_color_item_buffer_name, NULL, NULL, NULL); /* network */ ptr_section = weechat_config_new_section (irc_config_file, "network", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 381e54cbc..02b2ed4b0 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -105,6 +105,7 @@ extern struct t_config_option *irc_config_color_notice; extern struct t_config_option *irc_config_color_input_nick; extern struct t_config_option *irc_config_color_item_away; extern struct t_config_option *irc_config_color_item_channel_modes; +extern struct t_config_option *irc_config_color_item_buffer_name_ssl; extern struct t_config_option *irc_config_network_connection_timeout; extern struct t_config_option *irc_config_network_default_msg_part; diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c index ca22b97c3..ba8346999 100644 --- a/src/plugins/irc/irc-display.c +++ b/src/plugins/irc/irc-display.c @@ -29,6 +29,7 @@ #include "../weechat-plugin.h" #include "irc.h" #include "irc-channel.h" +#include "irc-color.h" #include "irc-command.h" #include "irc-config.h" #include "irc-nick.h" diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index d2c77814b..6d0d3c47f 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -29,6 +29,7 @@ #include "../weechat-plugin.h" #include "irc.h" #include "irc-nick.h" +#include "irc-color.h" #include "irc-config.h" #include "irc-server.h" #include "irc-channel.h" diff --git a/src/plugins/irc/irc.h b/src/plugins/irc/irc.h index a9f43aedc..ed591ef06 100644 --- a/src/plugins/irc/irc.h +++ b/src/plugins/irc/irc.h @@ -23,35 +23,6 @@ #define weechat_plugin weechat_irc_plugin #define IRC_PLUGIN_NAME "irc" -#define IRC_COLOR_CHAT weechat_color("chat") -#define IRC_COLOR_CHAT_CHANNEL weechat_color("chat_channel") -#define IRC_COLOR_CHAT_DELIMITERS weechat_color("chat_delimiters") -#define IRC_COLOR_CHAT_HOST weechat_color("chat_host") -#define IRC_COLOR_CHAT_NICK weechat_color("chat_nick") -#define IRC_COLOR_CHAT_NICK_SELF weechat_color("chat_nick_self") -#define IRC_COLOR_CHAT_NICK_OTHER weechat_color("chat_nick_other") -#define IRC_COLOR_CHAT_SERVER weechat_color("chat_server") -#define IRC_COLOR_CHAT_VALUE weechat_color("chat_value") -#define IRC_COLOR_NICKLIST_PREFIX1 weechat_color("nicklist_prefix1") -#define IRC_COLOR_NICKLIST_PREFIX2 weechat_color("nicklist_prefix2") -#define IRC_COLOR_NICKLIST_PREFIX3 weechat_color("nicklist_prefix3") -#define IRC_COLOR_NICKLIST_PREFIX4 weechat_color("nicklist_prefix4") -#define IRC_COLOR_NICKLIST_PREFIX5 weechat_color("nicklist_prefix5") -#define IRC_COLOR_BAR_FG weechat_color("bar_fg") -#define IRC_COLOR_BAR_BG weechat_color("bar_bg") -#define IRC_COLOR_BAR_DELIM weechat_color("bar_delim") -#define IRC_COLOR_STATUS_NUMBER weechat_color(weechat_config_string(weechat_config_get("weechat.color.status_number"))) -#define IRC_COLOR_STATUS_NAME weechat_color(weechat_config_string(weechat_config_get("weechat.color.status_name"))) -#define IRC_COLOR_MESSAGE_JOIN weechat_color(weechat_config_string(irc_config_color_message_join)) -#define IRC_COLOR_MESSAGE_QUIT weechat_color(weechat_config_string(irc_config_color_message_quit)) -#define IRC_COLOR_NOTICE weechat_color(weechat_config_string(irc_config_color_notice)) -#define IRC_COLOR_INPUT_NICK weechat_color(weechat_config_string(irc_config_color_input_nick)) -#define IRC_COLOR_ITEM_AWAY weechat_color(weechat_config_string(irc_config_color_item_away)) -#define IRC_COLOR_ITEM_CHANNEL_MODES weechat_color(weechat_config_string(irc_config_color_item_channel_modes)) -#define IRC_COLOR_NICK_IN_SERVER_MESSAGE(nick) \ - ((nick && weechat_config_boolean(irc_config_look_color_nicks_in_server_messages)) ? \ - nick->color : IRC_COLOR_CHAT_NICK) - extern struct t_weechat_plugin *weechat_irc_plugin; extern struct t_hook *irc_hook_timer_check_away;