1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

irc: add option irc.look.pv_tags

This commit is contained in:
Sebastien Helleu
2013-07-11 22:32:14 +02:00
parent fa9f787e14
commit 2cbdbb45d6
21 changed files with 259 additions and 113 deletions
+14 -6
View File
@@ -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",
+1
View File
@@ -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;
+17 -7
View File
@@ -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,