mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 23:06:38 +02:00
core: make nick prefix/suffix dynamic (move options from irc plugin to core, add logger options) (bug #37531)
This commit is contained in:
@@ -73,8 +73,6 @@
|
||||
#define IRC_COLOR_NICK_PREFIX_HALFOP weechat_color(weechat_config_string(irc_config_color_nick_prefix_halfop))
|
||||
#define IRC_COLOR_NICK_PREFIX_VOICE weechat_color(weechat_config_string(irc_config_color_nick_prefix_voice))
|
||||
#define IRC_COLOR_NICK_PREFIX_USER weechat_color(weechat_config_string(irc_config_color_nick_prefix_user))
|
||||
#define IRC_COLOR_NICK_PREFIX weechat_color(weechat_config_string(irc_config_color_nick_prefix))
|
||||
#define IRC_COLOR_NICK_SUFFIX weechat_color(weechat_config_string(irc_config_color_nick_suffix))
|
||||
#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")
|
||||
|
||||
@@ -59,8 +59,6 @@ struct t_config_option *irc_config_look_server_buffer;
|
||||
struct t_config_option *irc_config_look_pv_buffer;
|
||||
struct t_config_option *irc_config_look_new_channel_position;
|
||||
struct t_config_option *irc_config_look_new_pv_position;
|
||||
struct t_config_option *irc_config_look_nick_prefix;
|
||||
struct t_config_option *irc_config_look_nick_suffix;
|
||||
struct t_config_option *irc_config_look_nick_mode;
|
||||
struct t_config_option *irc_config_look_nick_mode_empty;
|
||||
struct t_config_option *irc_config_look_nick_color_force;
|
||||
@@ -107,8 +105,6 @@ struct t_config_option *irc_config_color_message_join;
|
||||
struct t_config_option *irc_config_color_message_quit;
|
||||
struct t_config_option *irc_config_color_mirc_remap;
|
||||
struct t_config_option *irc_config_color_nick_prefixes;
|
||||
struct t_config_option *irc_config_color_nick_prefix;
|
||||
struct t_config_option *irc_config_color_nick_suffix;
|
||||
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;
|
||||
@@ -2209,16 +2205,6 @@ irc_config_init ()
|
||||
"of server)"),
|
||||
"none|next|near_server", 0, 0, "none",
|
||||
NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_nick_prefix = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_prefix", "string",
|
||||
N_("text to display before nick in chat window"),
|
||||
NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_nick_suffix = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_suffix", "string",
|
||||
N_("text to display after nick in chat window"),
|
||||
NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_nick_mode = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_mode", "integer",
|
||||
@@ -2551,20 +2537,6 @@ irc_config_init ()
|
||||
NULL, 0, 0, "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;"
|
||||
"v:yellow;*:lightblue", NULL, 0, NULL, NULL,
|
||||
&irc_config_change_color_nick_prefixes, NULL, NULL, NULL);
|
||||
irc_config_color_nick_prefix = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_prefix", "color",
|
||||
N_("color for nick prefix (prefix is custom string displayed "
|
||||
"before nick)"),
|
||||
NULL, -1, 0, "green", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_color_nick_suffix = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_suffix", "color",
|
||||
N_("color for nick suffix (suffix is custom string displayed "
|
||||
"after nick)"),
|
||||
NULL, -1, 0, "green", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_color_notice = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"notice", "color",
|
||||
|
||||
@@ -101,8 +101,6 @@ extern struct t_config_option *irc_config_look_server_buffer;
|
||||
extern struct t_config_option *irc_config_look_pv_buffer;
|
||||
extern struct t_config_option *irc_config_look_new_channel_position;
|
||||
extern struct t_config_option *irc_config_look_new_pv_position;
|
||||
extern struct t_config_option *irc_config_look_nick_prefix;
|
||||
extern struct t_config_option *irc_config_look_nick_suffix;
|
||||
extern struct t_config_option *irc_config_look_nick_mode;
|
||||
extern struct t_config_option *irc_config_look_nick_mode_empty;
|
||||
extern struct t_config_option *irc_config_look_nick_color_force;
|
||||
@@ -147,8 +145,6 @@ extern struct t_config_option *irc_config_color_message_join;
|
||||
extern struct t_config_option *irc_config_color_message_quit;
|
||||
extern struct t_config_option *irc_config_color_mirc_remap;
|
||||
extern struct t_config_option *irc_config_color_nick_prefixes;
|
||||
extern struct t_config_option *irc_config_color_nick_prefix;
|
||||
extern struct t_config_option *irc_config_color_nick_suffix;
|
||||
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;
|
||||
|
||||
@@ -956,22 +956,10 @@ irc_nick_as_prefix (struct t_irc_server *server, struct t_irc_nick *nick,
|
||||
{
|
||||
static char result[256];
|
||||
|
||||
snprintf (result, sizeof (result), "%s%s%s%s%s%s%s\t",
|
||||
(weechat_config_string (irc_config_look_nick_prefix)
|
||||
&& weechat_config_string (irc_config_look_nick_prefix)[0]) ?
|
||||
IRC_COLOR_NICK_PREFIX : "",
|
||||
(weechat_config_string (irc_config_look_nick_prefix)
|
||||
&& weechat_config_string (irc_config_look_nick_prefix)[0]) ?
|
||||
weechat_config_string (irc_config_look_nick_prefix) : "",
|
||||
snprintf (result, sizeof (result), "%s%s%s\t",
|
||||
irc_nick_mode_for_display (server, nick, 1),
|
||||
(force_color) ? force_color : ((nick) ? nick->color : ((nickname) ? irc_nick_find_color (nickname) : IRC_COLOR_CHAT_NICK)),
|
||||
(nick) ? nick->name : nickname,
|
||||
(weechat_config_string (irc_config_look_nick_suffix)
|
||||
&& weechat_config_string (irc_config_look_nick_suffix)[0]) ?
|
||||
IRC_COLOR_NICK_SUFFIX : "",
|
||||
(weechat_config_string (irc_config_look_nick_suffix)
|
||||
&& weechat_config_string (irc_config_look_nick_suffix)[0]) ?
|
||||
weechat_config_string (irc_config_look_nick_suffix) : "");
|
||||
(nick) ? nick->name : nickname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user