diff options
author | Simmo Saan <simmo.saan@gmail.com> | 2019-09-23 21:22:49 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-09-23 21:22:49 +0200 |
commit | e437613acb2c2058aa7974a0e1f2cedc56177382 (patch) | |
tree | 73d1f44aee5fd41080cba05229c2e54e1f065fc7 /src/plugins | |
parent | c5ffc3917f016f7c62788c11cec768f1ba0f002d (diff) | |
download | weechat-e437613acb2c2058aa7974a0e1f2cedc56177382.zip |
irc: add separate options for kick/kill message coloring (closes #683)
Add new options irc.color.message_kick and irc.color.reason_kick to be used
for coloring KICK and KILL messages.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-color.h | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.c | 14 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.h | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 20 |
4 files changed, 28 insertions, 10 deletions
diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index af87c446c..1c5b2fd0e 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -85,7 +85,9 @@ #define IRC_COLOR_STATUS_NAME_SSL weechat_color("status_name_ssl") #define IRC_COLOR_MESSAGE_JOIN weechat_color(weechat_config_string(irc_config_color_message_join)) #define IRC_COLOR_MESSAGE_CHGHOST weechat_color(weechat_config_string(irc_config_color_message_chghost)) +#define IRC_COLOR_MESSAGE_KICK weechat_color(weechat_config_string(irc_config_color_message_kick)) #define IRC_COLOR_MESSAGE_QUIT weechat_color(weechat_config_string(irc_config_color_message_quit)) +#define IRC_COLOR_REASON_KICK weechat_color(weechat_config_string(irc_config_color_reason_kick)) #define IRC_COLOR_REASON_QUIT weechat_color(weechat_config_string(irc_config_color_reason_quit)) #define IRC_COLOR_TOPIC_CURRENT weechat_color(weechat_config_string(irc_config_color_topic_current)) #define IRC_COLOR_TOPIC_OLD weechat_color(weechat_config_string(irc_config_color_topic_old)) diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 2f79614f0..b95354ca1 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -116,10 +116,12 @@ struct t_config_option *irc_config_color_item_lag_finished; struct t_config_option *irc_config_color_item_nick_modes; struct t_config_option *irc_config_color_message_join; struct t_config_option *irc_config_color_message_chghost; +struct t_config_option *irc_config_color_message_kick; 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_notice; +struct t_config_option *irc_config_color_reason_kick; struct t_config_option *irc_config_color_reason_quit; struct t_config_option *irc_config_color_topic_current; struct t_config_option *irc_config_color_topic_new; @@ -3186,6 +3188,12 @@ irc_config_init () N_("color for text in chghost messages"), NULL, -1, 0, "brown", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_message_kick = weechat_config_new_option ( + irc_config_file, ptr_section, + "message_kick", "color", + N_("color for text in kick/kill messages"), + NULL, -1, 0, "red", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_color_message_quit = weechat_config_new_option ( irc_config_file, ptr_section, "message_quit", "color", @@ -3228,6 +3236,12 @@ irc_config_init () N_("color for text \"Notice\" in notices"), NULL, -1, 0, "green", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_reason_kick = weechat_config_new_option ( + irc_config_file, ptr_section, + "reason_kick", "color", + N_("color for reason in kick/kill messages"), + NULL, -1, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_color_reason_quit = weechat_config_new_option ( irc_config_file, ptr_section, "reason_quit", "color", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 36947c216..ad2099aaf 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -154,10 +154,12 @@ extern struct t_config_option *irc_config_color_item_lag_finished; extern struct t_config_option *irc_config_color_item_nick_modes; extern struct t_config_option *irc_config_color_message_join; extern struct t_config_option *irc_config_color_message_chghost; +extern struct t_config_option *irc_config_color_message_kick; 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_notice; +extern struct t_config_option *irc_config_color_reason_kick; extern struct t_config_option *irc_config_color_reason_quit; extern struct t_config_option *irc_config_color_topic_current; extern struct t_config_option *irc_config_color_topic_new; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 9b483930d..a5566c4cc 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1295,12 +1295,12 @@ IRC_PROTOCOL_CALLBACK(kick) weechat_prefix ("quit"), irc_nick_color_for_msg (server, 1, ptr_nick, nick), nick, - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, irc_nick_color_for_msg (server, 1, ptr_nick_kicked, argv[3]), argv[3], - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + IRC_COLOR_REASON_KICK, pos_comment, IRC_COLOR_CHAT_DELIMITERS); } @@ -1315,10 +1315,10 @@ IRC_PROTOCOL_CALLBACK(kick) weechat_prefix ("quit"), irc_nick_color_for_msg (server, 1, ptr_nick, nick), nick, - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, irc_nick_color_for_msg (server, 1, ptr_nick_kicked, argv[3]), argv[3], - IRC_COLOR_MESSAGE_QUIT); + IRC_COLOR_MESSAGE_KICK); } if (irc_server_strcasecmp (server, argv[3], server->nick) == 0) @@ -1414,12 +1414,12 @@ IRC_PROTOCOL_CALLBACK(kill) irc_protocol_tags (command, NULL, NULL, address), _("%s%sYou were killed by %s%s%s %s(%s%s%s)"), weechat_prefix ("quit"), - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, irc_nick_color_for_msg (server, 1, ptr_nick, nick), nick, - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + IRC_COLOR_REASON_KICK, pos_comment, IRC_COLOR_CHAT_DELIMITERS); } @@ -1432,10 +1432,10 @@ IRC_PROTOCOL_CALLBACK(kill) irc_protocol_tags (command, NULL, NULL, address), _("%s%sYou were killed by %s%s%s"), weechat_prefix ("quit"), - IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_MESSAGE_KICK, irc_nick_color_for_msg (server, 1, ptr_nick, nick), nick, - IRC_COLOR_MESSAGE_QUIT); + IRC_COLOR_MESSAGE_KICK); } if (irc_server_strcasecmp (server, argv[2], server->nick) == 0) |