1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 12:56:37 +02:00

Add new option irc.color.item_buffer_name_ssl (task #10339)

This commit is contained in:
Sebastien Helleu
2010-04-20 22:19:43 +02:00
parent b06c02f199
commit 9cbcc24d4c
20 changed files with 152 additions and 48 deletions
+4 -4
View File
@@ -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);
+32
View File
@@ -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);
+12 -5
View File
@@ -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",
+1
View File
@@ -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;
+1
View File
@@ -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"
+1
View File
@@ -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"
-29
View File
@@ -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;