1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: add buffer property "highlight_tags_restrict", rename option irc.look.highlight_tags to irc.look.highlight_tags_restrict

The buffer property "highlight_tags" is renamed to "highlight_tags_restrict".
New behavior for buffer property "highlight_tags": force highlight on tags.
Option irc.look.highlight_tags is renamed to irc.look.highlight_tags_restrict.
This commit is contained in:
Sebastien Helleu
2013-12-15 13:45:40 +01:00
parent 52cbd0b921
commit d52d214448
36 changed files with 396 additions and 134 deletions
+4 -4
View File
@@ -253,11 +253,11 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
(channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
weechat_config_string (irc_config_look_highlight_channel) :
weechat_config_string (irc_config_look_highlight_pv));
if (weechat_config_string (irc_config_look_highlight_tags)
&& weechat_config_string (irc_config_look_highlight_tags)[0])
if (weechat_config_string (irc_config_look_highlight_tags_restrict)
&& weechat_config_string (irc_config_look_highlight_tags_restrict)[0])
{
weechat_buffer_set (new_buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
weechat_buffer_set (new_buffer, "highlight_tags_restrict",
weechat_config_string (irc_config_look_highlight_tags_restrict));
}
}
+17 -14
View File
@@ -69,7 +69,7 @@ struct t_config_option *irc_config_look_display_pv_back;
struct t_config_option *irc_config_look_highlight_server;
struct t_config_option *irc_config_look_highlight_channel;
struct t_config_option *irc_config_look_highlight_pv;
struct t_config_option *irc_config_look_highlight_tags;
struct t_config_option *irc_config_look_highlight_tags_restrict;
struct t_config_option *irc_config_look_item_away_message;
struct t_config_option *irc_config_look_item_channel_modes_hide_key;
struct t_config_option *irc_config_look_item_display_server;
@@ -488,12 +488,12 @@ irc_config_change_look_item_nick_prefix (void *data,
}
/*
* Callback for changes on option "irc.look.highlight_tags".
* Callback for changes on option "irc.look.highlight_tags_restrict".
*/
void
irc_config_change_look_highlight_tags (void *data,
struct t_config_option *option)
irc_config_change_look_highlight_tags_restrict (void *data,
struct t_config_option *option)
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
@@ -507,16 +507,16 @@ irc_config_change_look_highlight_tags (void *data,
{
if (ptr_server->buffer)
{
weechat_buffer_set (ptr_server->buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
weechat_buffer_set (ptr_server->buffer, "highlight_tags_restrict",
weechat_config_string (irc_config_look_highlight_tags_restrict));
}
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->buffer)
{
weechat_buffer_set (ptr_channel->buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
weechat_buffer_set (ptr_channel->buffer, "highlight_tags_restrict",
weechat_config_string (irc_config_look_highlight_tags_restrict));
}
}
}
@@ -2343,14 +2343,17 @@ irc_config_init ()
"disables default highlight on nick, examples: \"$nick\", "
"\"(?-i)$nick\""),
NULL, 0, 0, "$nick", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_tags = weechat_config_new_option (
irc_config_look_highlight_tags_restrict = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_tags", "string",
N_("comma separated list of tags for messages that may produce "
"highlight (usually any message from another user, not server "
"messages,..)"),
"highlight_tags_restrict", "string",
N_("restrict highlights to these tags on irc buffers (to have "
"highlight on user messages but not server messages); tags "
"must be separated by a comma and \"+\" can be used to make a "
"logical \"and\" between tags; tags can start or end with \"*\" "
"to match more than one tag; an empty value allows highlight on any "
"tag"),
NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0, NULL, NULL,
&irc_config_change_look_highlight_tags, NULL, NULL, NULL);
&irc_config_change_look_highlight_tags_restrict, NULL, NULL, NULL);
irc_config_look_item_away_message = weechat_config_new_option (
irc_config_file, ptr_section,
"item_away_message", "boolean",
+1 -1
View File
@@ -117,7 +117,7 @@ extern struct t_config_option *irc_config_look_display_pv_back;
extern struct t_config_option *irc_config_look_highlight_server;
extern struct t_config_option *irc_config_look_highlight_channel;
extern struct t_config_option *irc_config_look_highlight_pv;
extern struct t_config_option *irc_config_look_highlight_tags;
extern struct t_config_option *irc_config_look_highlight_tags_restrict;
extern struct t_config_option *irc_config_look_item_away_message;
extern struct t_config_option *irc_config_look_item_channel_modes_hide_key;
extern struct t_config_option *irc_config_look_item_display_server;
+4 -4
View File
@@ -3460,11 +3460,11 @@ irc_server_create_buffer (struct t_irc_server *server)
/* set highlights settings on server buffer */
weechat_buffer_set (server->buffer, "highlight_words_add",
weechat_config_string (irc_config_look_highlight_server));
if (weechat_config_string (irc_config_look_highlight_tags)
&& weechat_config_string (irc_config_look_highlight_tags)[0])
if (weechat_config_string (irc_config_look_highlight_tags_restrict)
&& weechat_config_string (irc_config_look_highlight_tags_restrict)[0])
{
weechat_buffer_set (server->buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
weechat_buffer_set (server->buffer, "highlight_tags_restrict",
weechat_config_string (irc_config_look_highlight_tags_restrict));
}
irc_server_set_buffer_title (server);