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

irc: rename option irc.color.item_channel_modes to weechat.color.status_modes

This commit is contained in:
Sébastien Helleu
2024-05-12 09:45:53 +02:00
parent fb4d2d30f4
commit dcb8fcb6ed
9 changed files with 31 additions and 26 deletions
+1
View File
@@ -43,6 +43,7 @@ New features::
* api: add support of specifier `%!` for timestamp in function util_strftimeval
* api: add support of base64url in encode/decode functions
* fset: add option `-import` in command `/fset`
* irc: rename option irc.color.item_channel_modes to weechat.color.status_modes
* irc: add option `-all` in command `/allchan`, do not execute command on parted channels by default (issue #2085)
* irc: add server option "autojoin_delay" (delay before autojoin), use option "command_delay" before execution of the command (issue #862)
* relay: add "api" protocol (HTTP REST API), add option relay.look.display_clients, change option type relay.look.auto_open_buffer to string, rename option relay.weechat.commands to relay.network.commands, add option relay.network.time_window (issue #2066)
+6
View File
@@ -14,6 +14,12 @@ For a complete list of changes, please look at ChangeLog.
[[v4.3.0]]
== Version 4.3.0 (under dev)
[[v4.3.0_irc_color_channel_modes]]
=== Color of IRC channel modes
The option `irc.color.item_channel_modes` has been moved to core and renamed to
`weechat.color.status_modes`.
[[v4.3.0_signal_buffer_line_added]]
=== Signal "buffer_line_added"
+9
View File
@@ -285,6 +285,7 @@ struct t_config_option *config_color_status_data_msg = NULL;
struct t_config_option *config_color_status_data_other = NULL;
struct t_config_option *config_color_status_data_private = NULL;
struct t_config_option *config_color_status_filter = NULL;
struct t_config_option *config_color_status_modes = 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;
@@ -4881,6 +4882,14 @@ config_weechat_init_options ()
NULL, NULL, NULL,
&config_change_color, NULL, NULL,
NULL, NULL, NULL);
config_color_status_modes = config_file_new_option (
weechat_config_file, weechat_config_section_color,
"status_modes", "color",
N_("text color for buffer modes in status bar"),
NULL, -1, 0, "default", NULL, 0,
NULL, NULL, NULL,
&config_change_color, NULL, NULL,
NULL, NULL, NULL);
config_color_status_more = config_file_new_option (
weechat_config_file, weechat_config_section_color,
"status_more", "color",
+1
View File
@@ -337,6 +337,7 @@ extern struct t_config_option *config_color_status_data_msg;
extern struct t_config_option *config_color_status_data_other;
extern struct t_config_option *config_color_status_data_private;
extern struct t_config_option *config_color_status_filter;
extern struct t_config_option *config_color_status_modes;
extern struct t_config_option *config_color_status_more;
extern struct t_config_option *config_color_status_mouse;
extern struct t_config_option *config_color_status_name;
+9 -2
View File
@@ -1296,6 +1296,8 @@ gui_bar_item_buffer_modes_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
char *modes;
/* make C compiler happy */
(void) pointer;
(void) data;
@@ -1303,10 +1305,15 @@ gui_bar_item_buffer_modes_cb (const void *pointer, void *data,
(void) window;
(void) extra_info;
if (!buffer)
if (!buffer || !buffer->modes)
return NULL;
return (buffer->modes) ? strdup (buffer->modes) : NULL;
string_asprintf (
&modes,
"%s%s",
gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_modes))),
buffer->modes);
return modes;
}
/*
+5 -13
View File
@@ -578,7 +578,7 @@ void
irc_channel_set_buffer_modes (struct t_irc_server *server,
struct t_irc_channel *channel)
{
char *modes, *modes_without_args;
char *modes_without_args;
const char *pos_space;
if (!server || !channel || !channel->buffer)
@@ -599,18 +599,10 @@ irc_channel_set_buffer_modes (struct t_irc_server *server,
channel->modes, pos_space - channel->modes);
}
}
if (weechat_asprintf (
&modes, "%s%s",
IRC_COLOR_ITEM_CHANNEL_MODES,
(modes_without_args) ? modes_without_args : channel->modes) >= 0)
{
weechat_buffer_set (channel->buffer, "modes", modes);
free (modes);
}
else
{
weechat_buffer_set (channel->buffer, "modes", "");
}
weechat_buffer_set (
channel->buffer,
"modes",
(modes_without_args) ? modes_without_args : channel->modes);
free (modes_without_args);
}
else
-1
View File
@@ -97,7 +97,6 @@
#define IRC_COLOR_TOPIC_NEW weechat_color(weechat_config_string(irc_config_color_topic_new))
#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_ITEM_LAG_COUNTING weechat_color(weechat_config_string(irc_config_color_item_lag_counting))
#define IRC_COLOR_ITEM_LAG_FINISHED weechat_color(weechat_config_string(irc_config_color_item_lag_finished))
#define IRC_COLOR_ITEM_NICK_MODES weechat_color(weechat_config_string(irc_config_color_item_nick_modes))
-9
View File
@@ -135,7 +135,6 @@ struct t_config_option *irc_config_look_topic_strip_colors = NULL;
/* IRC config, color section */
struct t_config_option *irc_config_color_input_nick = NULL;
struct t_config_option *irc_config_color_item_channel_modes = NULL;
struct t_config_option *irc_config_color_item_lag_counting = NULL;
struct t_config_option *irc_config_color_item_lag_finished = NULL;
struct t_config_option *irc_config_color_item_nick_modes = NULL;
@@ -3727,14 +3726,6 @@ irc_config_init ()
NULL, NULL, NULL,
&irc_config_change_buffer_input_prompt, NULL, NULL,
NULL, NULL, NULL);
irc_config_color_item_channel_modes = weechat_config_new_option (
irc_config_file, irc_config_section_color,
"item_channel_modes", "color",
N_("color for channel modes, near channel name"),
NULL, -1, 0, "default", NULL, 0,
NULL, NULL, NULL,
&irc_config_change_buffer_modes, NULL, NULL,
NULL, NULL, NULL);
irc_config_color_item_lag_counting = weechat_config_new_option (
irc_config_file, irc_config_section_color,
"item_lag_counting", "color",
-1
View File
@@ -168,7 +168,6 @@ extern struct t_config_option *irc_config_look_temporary_servers;
extern struct t_config_option *irc_config_look_topic_strip_colors;
extern struct t_config_option *irc_config_color_input_nick;
extern struct t_config_option *irc_config_color_item_channel_modes;
extern struct t_config_option *irc_config_color_item_lag_counting;
extern struct t_config_option *irc_config_color_item_lag_finished;
extern struct t_config_option *irc_config_color_item_nick_modes;