mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 18:23:13 +02:00
core: add option weechat.color.status_name_insecure (issue #1920)
Default value of option weechat.color.status_name_tls is set to white instead of lightgreen. Now all servers/channels connected with TLS are white, and those without TLS are lightmagenta.
This commit is contained in:
+12
-2
@@ -282,6 +282,7 @@ struct t_config_option *config_color_status_filter = NULL;
|
||||
struct t_config_option *config_color_status_more = NULL;
|
||||
struct t_config_option *config_color_status_mouse = NULL;
|
||||
struct t_config_option *config_color_status_name = NULL;
|
||||
struct t_config_option *config_color_status_name_insecure = NULL;
|
||||
struct t_config_option *config_color_status_name_tls = NULL;
|
||||
struct t_config_option *config_color_status_nicklist_count = NULL;
|
||||
struct t_config_option *config_color_status_number = NULL;
|
||||
@@ -4547,12 +4548,21 @@ config_weechat_init_options ()
|
||||
NULL, NULL, NULL,
|
||||
&config_change_color, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
config_color_status_name_insecure = config_file_new_option (
|
||||
weechat_config_file, weechat_config_section_color,
|
||||
"status_name_insecure", "color",
|
||||
N_("text color for current buffer name in status bar, if data are "
|
||||
"exchanged and not secured with a protocol like TLS"),
|
||||
NULL, -1, 0, "lightmagenta", NULL, 0,
|
||||
NULL, NULL, NULL,
|
||||
&config_change_color, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
config_color_status_name_tls = config_file_new_option (
|
||||
weechat_config_file, weechat_config_section_color,
|
||||
"status_name_tls", "color",
|
||||
N_("text color for current buffer name in status bar, if data are "
|
||||
"secured with a protocol like TLS"),
|
||||
NULL, -1, 0, "lightgreen", NULL, 0,
|
||||
"exchanged and secured with a protocol like TLS"),
|
||||
NULL, -1, 0, "white", NULL, 0,
|
||||
NULL, NULL, NULL,
|
||||
&config_change_color, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
@@ -137,7 +137,7 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name)
|
||||
snprintf (buf_name, sizeof (buf_name), "%s%s[%s%s%s]",
|
||||
_("server"),
|
||||
IRC_COLOR_BAR_DELIM,
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME,
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME_INSECURE,
|
||||
server->name,
|
||||
IRC_COLOR_BAR_DELIM);
|
||||
}
|
||||
@@ -151,11 +151,11 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name)
|
||||
"%s%s%s%s%s%s%s%s%s%s",
|
||||
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",
|
||||
(part_from_channel) ? "(" : "",
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME,
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME_INSECURE,
|
||||
(server && display_server) ? server->name : "",
|
||||
(server && display_server) ? IRC_COLOR_BAR_DELIM : "",
|
||||
(server && display_server) ? "/" : "",
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME,
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME_INSECURE,
|
||||
(short_name) ? weechat_buffer_get_string (buffer, "short_name") : channel->name,
|
||||
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",
|
||||
(part_from_channel) ? ")" : "");
|
||||
@@ -190,7 +190,7 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name)
|
||||
|
||||
snprintf (buf, sizeof (buf),
|
||||
"%s%s",
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME,
|
||||
(server && server->tls_connected) ? IRC_COLOR_STATUS_NAME_TLS : IRC_COLOR_STATUS_NAME_INSECURE,
|
||||
buf_name);
|
||||
|
||||
return strdup (buf);
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
#define IRC_COLOR_NOTICE weechat_color(weechat_config_string(irc_config_color_notice))
|
||||
#define IRC_COLOR_STATUS_NUMBER weechat_color("status_number")
|
||||
#define IRC_COLOR_STATUS_NAME weechat_color("status_name")
|
||||
#define IRC_COLOR_STATUS_NAME_INSECURE weechat_color("status_name_insecure")
|
||||
#define IRC_COLOR_STATUS_NAME_TLS weechat_color("status_name_tls")
|
||||
#define IRC_COLOR_MESSAGE_JOIN weechat_color(weechat_config_string(irc_config_color_message_join))
|
||||
#define IRC_COLOR_MESSAGE_ACCOUNT weechat_color(weechat_config_string(irc_config_color_message_account))
|
||||
|
||||
Reference in New Issue
Block a user