diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-config.c | 20 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.h | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 24 |
3 files changed, 32 insertions, 13 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 584e8027e..34f4fd89f 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -90,6 +90,7 @@ struct t_config_option *irc_config_look_notify_tags_ison; struct t_config_option *irc_config_look_notify_tags_whois; struct t_config_option *irc_config_look_part_closes_buffer; struct t_config_option *irc_config_look_pv_buffer; +struct t_config_option *irc_config_look_pv_tags; struct t_config_option *irc_config_look_raw_messages; struct t_config_option *irc_config_look_server_buffer; struct t_config_option *irc_config_look_smart_filter; @@ -2442,19 +2443,19 @@ irc_config_init () irc_config_look_notify_tags_ison = weechat_config_new_option ( irc_config_file, ptr_section, "notify_tags_ison", "string", - N_("comma separated list of tags used in messages printed by notify " + N_("comma separated list of tags used in messages displayed by notify " "when a nick joins or quits server (result of command ison), " - "for example: \"notify_highlight\", \"notify_message\" or " - "\"notify_private\""), + "for example: \"notify_message\", \"notify_private\" or " + "\"notify_highlight\""), NULL, 0, 0, "notify_message", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_notify_tags_whois = weechat_config_new_option ( irc_config_file, ptr_section, "notify_tags_whois", "string", - N_("comma separated list of tags used in messages printed by notify " + N_("comma separated list of tags used in messages displayed by notify " "when a nick away status changes (result of command whois), " - "for example: \"notify_highlight\", \"notify_message\" or " - "\"notify_private\""), + "for example: \"notify_message\", \"notify_private\" or " + "\"notify_highlight\""), NULL, 0, 0, "notify_message", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_part_closes_buffer = weechat_config_new_option ( @@ -2469,6 +2470,13 @@ irc_config_init () "independent|merge_by_server|merge_all", 0, 0, "independent", NULL, 0, NULL, NULL, &irc_config_change_look_pv_buffer, NULL, NULL, NULL); + irc_config_look_pv_tags = weechat_config_new_option ( + irc_config_file, ptr_section, + "pv_tags", "string", + N_("comma separated list of tags used in private messages, for example: " + "\"notify_message\", \"notify_private\" or \"notify_highlight\""), + NULL, 0, 0, "notify_private", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); irc_config_look_raw_messages = weechat_config_new_option ( irc_config_file, ptr_section, "raw_messages", "integer", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index ddd4a0944..a5762ef91 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -138,6 +138,7 @@ extern struct t_config_option *irc_config_look_notify_tags_ison; extern struct t_config_option *irc_config_look_notify_tags_whois; extern struct t_config_option *irc_config_look_part_closes_buffer; extern struct t_config_option *irc_config_look_pv_buffer; +extern struct t_config_option *irc_config_look_pv_tags; extern struct t_config_option *irc_config_look_raw_messages; extern struct t_config_option *irc_config_look_server_buffer; extern struct t_config_option *irc_config_look_smart_filter; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index bde83fa0a..59431d722 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1510,8 +1510,8 @@ IRC_PROTOCOL_CALLBACK(pong) IRC_PROTOCOL_CALLBACK(privmsg) { - char *pos_args, *pos_target, str_tags[256], *str_color; - const char *remote_nick; + char *pos_args, *pos_target, str_tags[1024], *str_color; + const char *remote_nick, *pv_tags; int msg_op, msg_voice, is_channel, nick_is_me; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; @@ -1665,11 +1665,21 @@ IRC_PROTOCOL_CALLBACK(privmsg) else str_color = irc_color_for_tags (weechat_config_color (weechat_config_get ("weechat.color.chat_nick_other"))); } - snprintf (str_tags, sizeof (str_tags), - (nick_is_me) ? - "notify_none,no_highlight,prefix_nick_%s" : - "notify_private,prefix_nick_%s", - (str_color) ? str_color : "default"); + if (nick_is_me) + { + snprintf (str_tags, sizeof (str_tags), + "notify_none,no_highlight,prefix_nick_%s", + (str_color) ? str_color : "default"); + } + else + { + pv_tags = weechat_config_string (irc_config_look_pv_tags); + snprintf (str_tags, sizeof (str_tags), + "%s%sprefix_nick_%s", + (pv_tags && pv_tags[0]) ? pv_tags : "", + (pv_tags && pv_tags[0]) ? "," : "", + (str_color) ? str_color : "default"); + } if (str_color) free (str_color); weechat_printf_date_tags (ptr_channel->buffer, |