1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

Reintroduce highlight (move code from irc plugin to core)

This commit is contained in:
Sebastien Helleu
2008-06-01 22:09:12 +02:00
parent 4fa856c773
commit bd436db2bc
26 changed files with 1562 additions and 1700 deletions
+9
View File
@@ -81,6 +81,15 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
"nicklist_group", 1);
}
/* set highlights settings on channel buffer */
weechat_buffer_set (new_buffer, "highlight_words", server->nick);
if (weechat_config_string (irc_config_look_highlight_tags)
&& weechat_config_string (irc_config_look_highlight_tags)[0])
{
weechat_buffer_set (new_buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
}
/* initialize new channel */
new_channel->type = channel_type;
new_channel->name = strdup (channel_name);
+8 -7
View File
@@ -54,9 +54,9 @@ struct t_config_option *irc_config_look_nick_prefix;
struct t_config_option *irc_config_look_nick_suffix;
struct t_config_option *irc_config_look_nick_completion_smart;
struct t_config_option *irc_config_look_display_away;
struct t_config_option *irc_config_look_highlight_tags;
struct t_config_option *irc_config_look_show_away_once;
struct t_config_option *irc_config_look_notice_as_pv;
struct t_config_option *irc_config_look_highlight;
/* IRC config, network section */
@@ -905,6 +905,13 @@ irc_config_init ()
"display_away", "integer",
N_("display message when (un)marking as away"),
"off|local|channel", 0, 0, "local", NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_tags = 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,..)"),
NULL, 0, 0, "irc_privmsg,irc_notice", NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_show_away_once = weechat_config_new_option (
irc_config_file, ptr_section,
"show_away_once", "boolean",
@@ -915,12 +922,6 @@ irc_config_init ()
"notice_as_pv", "boolean",
N_("display notices as private messages"),
NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight", "string",
N_("comma separated list of words to highlight (case insensitive "
"comparison, words may begin or end with \"*\" for partial match)"),
NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL);
ptr_section = weechat_config_new_section (irc_config_file, "network",
0, 0,
+1 -1
View File
@@ -66,9 +66,9 @@ extern struct t_config_option *irc_config_look_nick_prefix;
extern struct t_config_option *irc_config_look_nick_suffix;
extern struct t_config_option *irc_config_look_nick_completion_smart;
extern struct t_config_option *irc_config_look_display_away;
extern struct t_config_option *irc_config_look_highlight_tags;
extern struct t_config_option *irc_config_look_show_away_once;
extern struct t_config_option *irc_config_look_notice_as_pv;
extern struct t_config_option *irc_config_look_highlight;
extern struct t_config_option *irc_config_network_default_msg_part;
extern struct t_config_option *irc_config_network_default_msg_quit;
+2
View File
@@ -73,6 +73,8 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified,
weechat_buffer_set (irc_debug_buffer,
"title", _("IRC debug messages"));
/* disabled all highlights on this debug buffer */
weechat_buffer_set (irc_debug_buffer, "highlight_words", "-");
}
buf = weechat_iconv_to_internal (NULL, message);
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -45,8 +45,7 @@
struct t_irc_server;
typedef int (t_irc_recv_func)(struct t_irc_server *server, char *comand,
int argc, char **argv, char **argv_eol,
int highlight);
int argc, char **argv, char **argv_eol);
struct t_irc_protocol_msg
{
+14
View File
@@ -233,6 +233,8 @@ irc_server_set_nick (struct t_irc_server *server, char *nick)
weechat_buffer_set (server->buffer, "nick", nick);
weechat_buffer_set (server->buffer, "highlight_words", nick);
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
@@ -1847,9 +1849,21 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
&irc_buffer_close_cb, NULL);
if (!server->buffer)
return 0;
weechat_buffer_set (server->buffer, "display", "1");
weechat_hook_signal_send ("logger_backlog",
WEECHAT_HOOK_SIGNAL_POINTER, server->buffer);
/* set highlights settings on server buffer */
if (server->nick)
weechat_buffer_set (server->buffer, "highlight_words", server->nick);
if (weechat_config_string (irc_config_look_highlight_tags)
&& weechat_config_string (irc_config_look_highlight_tags)[0])
{
weechat_buffer_set (server->buffer, "highlight_tags",
weechat_config_string (irc_config_look_highlight_tags));
}
}
#ifndef HAVE_GNUTLS