diff --git a/ChangeLog b/ChangeLog index bfe3a6c89..9c0d9e0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ Version 0.4.2 (under dev!) buffer per nick * relay: add command "ping" in weechat protocol (task #12689) * relay: fix binding to an IP address (bug #39119) +* xfer: add option xfer.look.pv_tags * xfer: fix compilation on OpenBSD (bug #39071) Version 0.4.1 (2013-05-20) diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c index d658633ad..66217c356 100644 --- a/src/plugins/xfer/xfer-chat.c +++ b/src/plugins/xfer/xfer-chat.c @@ -30,6 +30,7 @@ #include "xfer.h" #include "xfer-chat.h" #include "xfer-buffer.h" +#include "xfer-config.h" /* @@ -110,6 +111,7 @@ xfer_chat_recv_cb (void *arg_xfer, int fd) char *buf2, *pos, *ptr_buf, *ptr_buf2, *next_ptr_buf; char *ptr_buf_decoded, *ptr_buf_without_weechat_colors, *ptr_buf_color; char str_tags[256], *str_color; + const char *pv_tags; int num_read, length, ctcp_action; /* make C compiler happy */ @@ -183,10 +185,13 @@ xfer_chat_recv_cb (void *arg_xfer, int fd) ptr_buf2 = (ptr_buf_color) ? ptr_buf_color : ((ptr_buf_without_weechat_colors) ? ptr_buf_without_weechat_colors : ((ptr_buf_decoded) ? ptr_buf_decoded : ptr_buf)); + pv_tags = weechat_config_string (xfer_config_look_pv_tags); if (ctcp_action) { snprintf (str_tags, sizeof (str_tags), - "irc_privmsg,irc_action,notify_message,nick_%s,log1", + "irc_privmsg,irc_action,%s%snick_%s,log1", + (pv_tags && pv_tags[0]) ? pv_tags : "", + (pv_tags && pv_tags[0]) ? "," : "", xfer->remote_nick); weechat_printf_tags (xfer->buffer, str_tags, @@ -205,7 +210,9 @@ xfer_chat_recv_cb (void *arg_xfer, int fd) (xfer->remote_nick_color) ? xfer->remote_nick_color : weechat_config_color (weechat_config_get ("weechat.color.chat_nick_other"))); snprintf (str_tags, sizeof (str_tags), - "irc_privmsg,notify_message,prefix_nick_%s,nick_%s,log1", + "irc_privmsg,%s%sprefix_nick_%s,nick_%s,log1", + (pv_tags && pv_tags[0]) ? pv_tags : "", + (pv_tags && pv_tags[0]) ? "," : "", (str_color) ? str_color : "default", xfer->remote_nick); if (str_color) diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index 64ccf2806..94612d59a 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -34,6 +34,7 @@ struct t_config_file *xfer_config_file = NULL; struct t_config_option *xfer_config_look_auto_open_buffer; struct t_config_option *xfer_config_look_progress_bar_size; +struct t_config_option *xfer_config_look_pv_tags; /* xfer config, color section */ @@ -134,6 +135,13 @@ xfer_config_init () N_("size of progress bar, in chars (if 0, progress bar is disabled)"), NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, 0, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); + xfer_config_look_pv_tags = weechat_config_new_option ( + xfer_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); ptr_section = weechat_config_new_section (xfer_config_file, "color", 0, 0, diff --git a/src/plugins/xfer/xfer-config.h b/src/plugins/xfer/xfer-config.h index 17b9f1399..630483c79 100644 --- a/src/plugins/xfer/xfer-config.h +++ b/src/plugins/xfer/xfer-config.h @@ -28,6 +28,7 @@ extern struct t_config_file *xfer_config; extern struct t_config_option *xfer_config_look_auto_open_buffer; extern struct t_config_option *xfer_config_look_progress_bar_size; +extern struct t_config_option *xfer_config_look_pv_tags; extern struct t_config_option *xfer_config_color_status[]; extern struct t_config_option *xfer_config_color_text;