mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
Refresh nicks colors in nicklist when changing option weechat.color.chat_nick_colors
This commit is contained in:
@@ -190,6 +190,10 @@ irc_config_compute_nick_colors ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if colors are displayed for nicks in nicklist, refresh them */
|
||||
if (weechat_config_boolean(irc_config_look_color_nicks_in_nicklist))
|
||||
irc_nick_nicklist_set_color_all ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -243,29 +247,11 @@ void
|
||||
irc_config_change_look_color_nicks_in_nicklist (void *data,
|
||||
struct t_config_option *option)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
irc_nick_nicklist_set (ptr_channel, ptr_nick, "color",
|
||||
irc_nick_get_color_for_nicklist (ptr_server,
|
||||
ptr_nick));
|
||||
}
|
||||
}
|
||||
}
|
||||
irc_nick_nicklist_set_color_all ();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -516,6 +516,35 @@ irc_nick_nicklist_set (struct t_irc_channel *channel,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_nick_nicklist_set_color_all: set nick colors in nicklist for all
|
||||
* servers/channels
|
||||
*/
|
||||
|
||||
void
|
||||
irc_nick_nicklist_set_color_all ()
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
irc_nick_nicklist_set (ptr_channel, ptr_nick, "color",
|
||||
irc_nick_get_color_for_nicklist (ptr_server,
|
||||
ptr_nick));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_nick_new: allocate a new nick for a channel and add it to the nick list
|
||||
*/
|
||||
|
||||
@@ -58,11 +58,7 @@ extern int irc_nick_has_prefix_mode (struct t_irc_server *server,
|
||||
extern int irc_nick_get_prefix_color (struct t_irc_server *server,
|
||||
struct t_irc_nick *nick);
|
||||
extern const char *irc_nick_get_prefix_color_name (int prefix_color);
|
||||
extern const char *irc_nick_get_color_for_nicklist (struct t_irc_server *server,
|
||||
struct t_irc_nick *nick);
|
||||
extern void irc_nick_nicklist_set (struct t_irc_channel *channel,
|
||||
struct t_irc_nick *nick,
|
||||
const char *property, const char *value);
|
||||
extern void irc_nick_nicklist_set_color_all ();
|
||||
extern struct t_irc_nick *irc_nick_new (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *nickname,
|
||||
|
||||
Reference in New Issue
Block a user