diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-04-28 14:27:31 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-04-28 14:27:31 +0200 |
commit | 43a53a87aa8635a6da38f0f5600d81d82f0de1f7 (patch) | |
tree | 6a8e5b8bf8ec3d5ef02f7266097490acc2149d59 /src | |
parent | 7baf4b8b22222141a5fb480f93a379a33def2ea9 (diff) | |
download | weechat-43a53a87aa8635a6da38f0f5600d81d82f0de1f7.zip |
irc: add new options irc.color.topic_old and irc.color.topic_new
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-color.h | 10 | ||||
-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 | 12 |
4 files changed, 30 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index 4cfe6b4c0..ad9b4c305 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -57,6 +57,9 @@ /* macros for WeeChat core and IRC colors */ +#define IRC_COLOR_BAR_FG weechat_color("bar_fg") +#define IRC_COLOR_BAR_BG weechat_color("bar_bg") +#define IRC_COLOR_BAR_DELIM weechat_color("bar_delim") #define IRC_COLOR_CHAT weechat_color("chat") #define IRC_COLOR_CHAT_CHANNEL weechat_color("chat_channel") #define IRC_COLOR_CHAT_DELIMITERS weechat_color("chat_delimiters") @@ -72,16 +75,15 @@ #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_BAR_FG weechat_color("bar_fg") -#define IRC_COLOR_BAR_BG weechat_color("bar_bg") -#define IRC_COLOR_BAR_DELIM weechat_color("bar_delim") +#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_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_QUIT weechat_color(weechat_config_string(irc_config_color_message_quit)) #define IRC_COLOR_REASON_QUIT weechat_color(weechat_config_string(irc_config_color_reason_quit)) -#define IRC_COLOR_NOTICE weechat_color(weechat_config_string(irc_config_color_notice)) +#define IRC_COLOR_TOPIC_OLD weechat_color(weechat_config_string(irc_config_color_topic_old)) +#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)) diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index d368cf47a..7a8dc0616 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -109,6 +109,8 @@ struct t_config_option *irc_config_color_item_channel_modes; struct t_config_option *irc_config_color_item_lag_counting; struct t_config_option *irc_config_color_item_lag_finished; struct t_config_option *irc_config_color_reason_quit; +struct t_config_option *irc_config_color_topic_old; +struct t_config_option *irc_config_color_topic_new; /* IRC config, network section */ @@ -2299,6 +2301,18 @@ irc_config_init () N_("color for reason in part/quit messages"), NULL, -1, 0, "default", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_topic_old = weechat_config_new_option ( + irc_config_file, ptr_section, + "topic_old", "color", + N_("color for old channel topic (when topic is changed)"), + NULL, -1, 0, "darkgray", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); + irc_config_color_topic_new = weechat_config_new_option ( + irc_config_file, ptr_section, + "topic_new", "color", + N_("color for new channel topic (when topic is changed)"), + NULL, -1, 0, "white", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); /* network */ ptr_section = weechat_config_new_section (irc_config_file, "network", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 912f1de6b..7b072f08e 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -132,6 +132,8 @@ 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_reason_quit; +extern struct t_config_option *irc_config_color_topic_old; +extern struct t_config_option *irc_config_color_topic_new; extern struct t_config_option *irc_config_network_autoreconnect_delay_growing; extern struct t_config_option *irc_config_network_autoreconnect_delay_max; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 5bc259e46..28eefd9fa 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1696,7 +1696,7 @@ IRC_PROTOCOL_CALLBACK(topic) ptr_buffer), irc_protocol_tags (command, NULL, NULL), _("%s%s%s%s has changed topic for %s%s%s " - "from \"%s%s\" to \"%s%s\""), + "from \"%s%s%s\" to \"%s%s%s\""), weechat_prefix ("network"), IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), nick, @@ -1704,8 +1704,10 @@ IRC_PROTOCOL_CALLBACK(topic) IRC_COLOR_CHAT_CHANNEL, argv[2], IRC_COLOR_CHAT, + IRC_COLOR_TOPIC_OLD, (old_topic_color) ? old_topic_color : ptr_channel->topic, IRC_COLOR_CHAT, + IRC_COLOR_TOPIC_NEW, (topic_color) ? topic_color : pos_topic, IRC_COLOR_CHAT); if (old_topic_color) @@ -1717,8 +1719,8 @@ IRC_PROTOCOL_CALLBACK(topic) command, NULL, ptr_buffer), irc_protocol_tags (command, NULL, NULL), - _("%s%s%s%s has changed topic for %s%s%s to " - "\"%s%s\""), + _("%s%s%s%s has changed topic for %s%s%s " + "to \"%s%s%s\""), weechat_prefix ("network"), IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), nick, @@ -1726,6 +1728,7 @@ IRC_PROTOCOL_CALLBACK(topic) IRC_COLOR_CHAT_CHANNEL, argv[2], IRC_COLOR_CHAT, + IRC_COLOR_TOPIC_NEW, (topic_color) ? topic_color : pos_topic, IRC_COLOR_CHAT); } @@ -1744,7 +1747,7 @@ IRC_PROTOCOL_CALLBACK(topic) ptr_buffer), irc_protocol_tags (command, NULL, NULL), _("%s%s%s%s has unset topic for %s%s%s " - "(old topic: \"%s%s\")"), + "(old topic: \"%s%s%s\")"), weechat_prefix ("network"), IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), nick, @@ -1752,6 +1755,7 @@ IRC_PROTOCOL_CALLBACK(topic) IRC_COLOR_CHAT_CHANNEL, argv[2], IRC_COLOR_CHAT, + IRC_COLOR_TOPIC_OLD, (old_topic_color) ? old_topic_color : ptr_channel->topic, IRC_COLOR_CHAT); if (old_topic_color) |