summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-04-11 13:57:00 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-04-11 13:57:00 +0200
commit9d128cad2279ff070d8204e1d3d7003f379c58da (patch)
treef75686cf81ed32debf23d13809dd90c7f0b0cb4d /src
parent8597f14bf6efe06000070c0e90fe729c843e8d7c (diff)
downloadweechat-9d128cad2279ff070d8204e1d3d7003f379c58da.zip
core: add messages counts in hotlist for each buffer, option weechat.look.hotlist_buffer_separator and tag "notify_none"
New options: - weechat.look.hotlist_buffer_separator - weechat.look.hotlist_count_max - weechat.look.hotlist_count_min_msg - weechat.color.status_count_msg - weechat.color.status_count_private - weechat.color.status_count_highlight - weechat.color.status_count_other
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-command.c3
-rw-r--r--src/core/wee-config.c48
-rw-r--r--src/core/wee-config.h7
-rw-r--r--src/core/wee-upgrade.c21
-rw-r--r--src/gui/gui-bar-item.c79
-rw-r--r--src/gui/gui-buffer.c2
-rw-r--r--src/gui/gui-hotlist.c77
-rw-r--r--src/gui/gui-hotlist.h37
-rw-r--r--src/gui/gui-line.c8
-rw-r--r--src/plugins/logger/logger.c13
10 files changed, 249 insertions, 46 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index ef159092e..e350ddd25 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -4818,7 +4818,8 @@ command_init ()
"The default key alt+'=' toggles filtering on/off.\n\n"
"Tags most commonly used:\n"
" no_filter, no_highlight, no_log, log0..log9 (log level),\n"
- " notify_message, notify_private, notify_highlight,\n"
+ " notify_none, notify_message, notify_private, "
+ "notify_highlight,\n"
" nick_xxx (xxx is nick in message),\n"
" irc_xxx (xxx is command name or number, see /server raw),\n"
" irc_numeric, irc_error, irc_action, irc_ctcp, "
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 4cff94579..aad659c53 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -88,6 +88,9 @@ struct t_config_option *config_look_highlight;
struct t_config_option *config_look_highlight_regex;
struct t_config_option *config_look_highlight_tags;
struct t_config_option *config_look_hline_char;
+struct t_config_option *config_look_hotlist_buffer_separator;
+struct t_config_option *config_look_hotlist_count_max;
+struct t_config_option *config_look_hotlist_count_min_msg;
struct t_config_option *config_look_hotlist_names_count;
struct t_config_option *config_look_hotlist_names_length;
struct t_config_option *config_look_hotlist_names_level;
@@ -161,6 +164,10 @@ struct t_config_option *config_color_status_data_msg;
struct t_config_option *config_color_status_data_private;
struct t_config_option *config_color_status_data_highlight;
struct t_config_option *config_color_status_data_other;
+struct t_config_option *config_color_status_count_msg;
+struct t_config_option *config_color_status_count_private;
+struct t_config_option *config_color_status_count_highlight;
+struct t_config_option *config_color_status_count_other;
struct t_config_option *config_color_status_more;
struct t_config_option *config_color_status_time;
struct t_config_option *config_color_input_text_not_found;
@@ -1595,6 +1602,23 @@ config_weechat_init_options ()
"will draw a real line with ncurses, but may cause bugs with URL "
"selection under some terminals), wide chars are NOT allowed here"),
NULL, 0, 0, "-", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ config_look_hotlist_buffer_separator = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_buffer_separator", "string",
+ N_("string displayed between buffers in hotlist"),
+ NULL, 0, 0, ", ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_hotlist_count_max = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_count_max", "integer",
+ N_("max number of messages count to display in hotlist for a buffer "
+ "(0 = never display messages count)"),
+ NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_hotlist_count_min_msg = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_count_min_msg", "integer",
+ N_("display messages count if number of messages is greater or equal "
+ "to this value"),
+ NULL, 1, 100, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_hotlist_names_count = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_count", "integer",
@@ -2089,6 +2113,30 @@ config_weechat_init_options ()
"(status bar)"),
NULL, -1, 0, "default", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_msg = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_msg", "color",
+ N_("text color for count of messages in hotlist (status bar)"),
+ NULL, -1, 0, "brown", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_private = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_private", "color",
+ N_("text color for count of private messages in hotlist (status bar)"),
+ NULL, -1, 0, "green", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_highlight = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_highlight", "color",
+ N_("text color for count of highlight messages in hotlist (status bar)"),
+ NULL, -1, 0, "magenta", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_other = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_other", "color",
+ N_("text color for count of other messages in hotlist (status bar)"),
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_status_more = config_file_new_option (
weechat_config_file, ptr_section,
"status_more", "color",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 002e07ee4..de7f62fe3 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -114,6 +114,9 @@ extern struct t_config_option *config_look_day_change_time_format;
extern struct t_config_option *config_look_highlight;
extern struct t_config_option *config_look_highlight_regex;
extern struct t_config_option *config_look_hline_char;
+extern struct t_config_option *config_look_hotlist_buffer_separator;
+extern struct t_config_option *config_look_hotlist_count_max;
+extern struct t_config_option *config_look_hotlist_count_min_msg;
extern struct t_config_option *config_look_hotlist_names_count;
extern struct t_config_option *config_look_hotlist_names_length;
extern struct t_config_option *config_look_hotlist_names_level;
@@ -185,6 +188,10 @@ extern struct t_config_option *config_color_status_data_msg;
extern struct t_config_option *config_color_status_data_private;
extern struct t_config_option *config_color_status_data_highlight;
extern struct t_config_option *config_color_status_data_other;
+extern struct t_config_option *config_color_status_count_msg;
+extern struct t_config_option *config_color_status_count_private;
+extern struct t_config_option *config_color_status_count_highlight;
+extern struct t_config_option *config_color_status_count_other;
extern struct t_config_option *config_color_status_more;
extern struct t_config_option *config_color_status_time;
extern struct t_config_option *config_color_input_text_not_found;
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index 2c2eb4963..4e351853c 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -304,9 +304,10 @@ upgrade_weechat_read_cb (void *data,
struct t_gui_nick_group *ptr_group;
struct t_gui_buffer *ptr_buffer, *ptr_buffer_for_merge;
struct t_gui_line *new_line;
+ struct t_gui_hotlist *new_hotlist;
struct timeval creation_time;
void *buf;
- int size, index, length;
+ int i, size, index, length;
/* make C compiler happy */
(void) data;
@@ -563,10 +564,20 @@ upgrade_weechat_read_cb (void *data,
if (buf)
{
memcpy (&creation_time, buf, size);
- gui_hotlist_add (ptr_buffer,
- infolist_integer (infolist, "priority"),
- &creation_time,
- 1);
+ new_hotlist = gui_hotlist_add (ptr_buffer,
+ infolist_integer (infolist, "priority"),
+ &creation_time,
+ 1);
+ if (new_hotlist)
+ {
+ for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
+ {
+ snprintf (option_name, sizeof (option_name),
+ "count_%02d", i);
+ new_hotlist->count[i] = infolist_integer (infolist,
+ option_name);
+ }
+ }
}
}
}
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index e3c589872..148be7724 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -1034,6 +1034,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
char buf[2048], format[32], *buffer_without_name_displayed;
struct t_gui_hotlist *ptr_hotlist;
int numbers_count, names_count, display_name;
+ int priority, priority_min, priority_min_displayed, private;
/* make C compiler happy */
(void) data;
@@ -1045,6 +1046,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
buf[0] = '\0';
+ /* TRANSLATORS: if possible use short word or abbreviation here ("Act" is abbreviation of "Activity" in english) */
strcat (buf, _("Act: "));
buffer_without_name_displayed = NULL;
@@ -1088,10 +1090,12 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
if (display_name || !buffer_without_name_displayed
|| (buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] == 0))
{
- if (numbers_count > 0)
+ if ((numbers_count > 0)
+ && (CONFIG_STRING(config_look_hotlist_buffer_separator))
+ && (CONFIG_STRING(config_look_hotlist_buffer_separator)[0]))
{
strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
- strcat (buf, ",");
+ strcat (buf, CONFIG_STRING(config_look_hotlist_buffer_separator));
}
switch (ptr_hotlist->priority)
@@ -1108,6 +1112,12 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
case GUI_HOTLIST_HIGHLIGHT:
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_data_highlight))));
break;
+ case GUI_HOTLIST_NUM_PRIORITIES:
+ /*
+ * this constant is used to count hotlist priorities only,
+ * it is never used as priority
+ */
+ break;
}
sprintf (buf + strlen (buf), "%d", ptr_hotlist->buffer->number);
numbers_count++;
@@ -1135,6 +1145,71 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] = 1;
}
+ /* display messages count by priority */
+ if (CONFIG_INTEGER(config_look_hotlist_count_max) > 0)
+ {
+ private = (ptr_hotlist->count[GUI_HOTLIST_PRIVATE] > 0) ? 1 : 0;
+ priority_min_displayed = ptr_hotlist->priority + 1;
+ priority_min = ptr_hotlist->priority - CONFIG_INTEGER(config_look_hotlist_count_max);
+ if (priority_min < 0)
+ priority_min = 0;
+ for (priority = ptr_hotlist->priority;
+ priority >= priority_min;
+ priority--)
+ {
+ if (!private && (priority == GUI_HOTLIST_PRIVATE))
+ continue;
+ if (private && (priority == GUI_HOTLIST_MESSAGE))
+ continue;
+ if (((priority == (int)ptr_hotlist->priority)
+ && (ptr_hotlist->count[priority] >= CONFIG_INTEGER(config_look_hotlist_count_min_msg)))
+ || ((priority != (int)ptr_hotlist->priority)
+ && (ptr_hotlist->count[priority] > 0)))
+ {
+ priority_min_displayed = priority;
+ }
+ }
+ if (priority_min_displayed <= (int)ptr_hotlist->priority)
+ {
+ for (priority = ptr_hotlist->priority;
+ priority >= priority_min_displayed;
+ priority--)
+ {
+ if (!private && (priority == GUI_HOTLIST_PRIVATE))
+ continue;
+ if (private && (priority == GUI_HOTLIST_MESSAGE))
+ continue;
+ strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
+ strcat (buf, (priority == (int)ptr_hotlist->priority) ? "(" : ",");
+ switch (priority)
+ {
+ case GUI_HOTLIST_LOW:
+ strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_count_other))));
+ break;
+ case GUI_HOTLIST_MESSAGE:
+ strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_count_msg))));
+ break;
+ case GUI_HOTLIST_PRIVATE:
+ strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_count_private))));
+ break;
+ case GUI_HOTLIST_HIGHLIGHT:
+ strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_count_highlight))));
+ break;
+ case GUI_HOTLIST_NUM_PRIORITIES:
+ /*
+ * this constant is used to count hotlist priorities only,
+ * it is never used as priority
+ */
+ break;
+ }
+ sprintf (buf + strlen (buf),
+ "%d", ptr_hotlist->count[priority]);
+ }
+ strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
+ strcat (buf, ")");
+ }
+ }
+
if (strlen (buf) > sizeof (buf) - 64)
break;
}
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 6f55badaa..162e1e62b 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -1346,7 +1346,7 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
error = NULL;
number = strtol (value, &error, 10);
if (error && !error[0])
- gui_hotlist_add (buffer, number, NULL, 1);
+ (void) gui_hotlist_add (buffer, number, NULL, 1);
}
}
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index ff951868b..953e3ddd2 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -131,7 +131,8 @@ gui_hotlist_free_all (struct t_gui_hotlist **hotlist,
*/
int
-gui_hotlist_check_buffer_notify (struct t_gui_buffer *buffer, int priority)
+gui_hotlist_check_buffer_notify (struct t_gui_buffer *buffer,
+ enum t_gui_hotlist_priority priority)
{
switch (priority)
{
@@ -142,6 +143,12 @@ gui_hotlist_check_buffer_notify (struct t_gui_buffer *buffer, int priority)
case GUI_HOTLIST_PRIVATE:
case GUI_HOTLIST_HIGHLIGHT:
return (buffer->notify >= 1);
+ case GUI_HOTLIST_NUM_PRIORITIES:
+ /*
+ * this constant is used to count hotlist priorities only,
+ * it is never used as priority
+ */
+ break;
}
return 1;
}
@@ -152,7 +159,8 @@ gui_hotlist_check_buffer_notify (struct t_gui_buffer *buffer, int priority)
*/
struct t_gui_hotlist *
-gui_hotlist_find_pos (struct t_gui_hotlist *hotlist, struct t_gui_hotlist *new_hotlist)
+gui_hotlist_find_pos (struct t_gui_hotlist *hotlist,
+ struct t_gui_hotlist *new_hotlist)
{
struct t_gui_hotlist *ptr_hotlist;
@@ -267,42 +275,59 @@ gui_hotlist_add_hotlist (struct t_gui_hotlist **hotlist,
/*
* gui_hotlist_add: add a buffer to hotlist, with priority
* if creation_time is NULL, current time is used
+ * return pointer to hotlist created or changed, or NULL if no
+ * hotlist was created/changed
*/
-void
-gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
+struct t_gui_hotlist *
+gui_hotlist_add (struct t_gui_buffer *buffer,
+ enum t_gui_hotlist_priority priority,
struct timeval *creation_time, int allow_current_buffer)
{
struct t_gui_hotlist *new_hotlist, *ptr_hotlist;
+ int i, count[GUI_HOTLIST_NUM_PRIORITIES];
if (!buffer || !gui_add_hotlist)
- return;
+ return NULL;
/* do not add current buffer */
if ((buffer == gui_current_window->buffer)
&& (!allow_current_buffer || (!gui_buffer_is_scrolled (buffer))))
- return;
+ return NULL;
/* do not add buffer if it is displayed in a window */
if (buffer->num_displayed > 0)
- return;
+ return NULL;
- if (priority < GUI_HOTLIST_MIN)
- priority = GUI_HOTLIST_MIN;
- else if (priority > GUI_HOTLIST_MAX)
+ if (priority > GUI_HOTLIST_MAX)
priority = GUI_HOTLIST_MAX;
/* check if priority is ok according to buffer notify level value */
if (!gui_hotlist_check_buffer_notify (buffer, priority))
- return;
+ return NULL;
+
+ /* init count */
+ for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
+ {
+ count[i] = 0;
+ }
ptr_hotlist = gui_hotlist_search (gui_hotlist, buffer);
if (ptr_hotlist)
{
/* return if priority is greater or equal than the one to add */
if (ptr_hotlist->priority >= priority)
- return;
- /* remove buffer if present with lower priority and go on */
+ {
+ ptr_hotlist->count[priority]++;
+ gui_hotlist_changed_signal ();
+ return ptr_hotlist;
+ }
+
+ /*
+ * if buffer is present with lower priority: save counts, remove it
+ * and go on
+ */
+ memcpy (count, ptr_hotlist->count, sizeof (ptr_hotlist->count));
gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist);
}
@@ -311,7 +336,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
{
log_printf (_("Error: not enough memory to add a buffer to "
"hotlist"));
- return;
+ return NULL;
}
new_hotlist->priority = priority;
@@ -321,12 +346,16 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
else
gettimeofday (&(new_hotlist->creation_time), NULL);
new_hotlist->buffer = buffer;
+ memcpy (new_hotlist->count, count, sizeof (new_hotlist->count));
+ new_hotlist->count[priority]++;
new_hotlist->next_hotlist = NULL;
new_hotlist->prev_hotlist = NULL;
gui_hotlist_add_hotlist (&gui_hotlist, &last_gui_hotlist, new_hotlist);
gui_hotlist_changed_signal ();
+
+ return new_hotlist;
}
/*
@@ -345,6 +374,7 @@ gui_hotlist_dup (struct t_gui_hotlist *hotlist)
memcpy (&(new_hotlist->creation_time), &(hotlist->creation_time),
sizeof (new_hotlist->creation_time));
new_hotlist->buffer = hotlist->buffer;
+ memcpy (new_hotlist->count, hotlist->count, sizeof (hotlist->count));
new_hotlist->prev_hotlist = NULL;
new_hotlist->next_hotlist = NULL;
return new_hotlist;
@@ -431,6 +461,8 @@ gui_hotlist_add_to_infolist (struct t_infolist *infolist,
struct t_gui_hotlist *hotlist)
{
struct t_infolist_item *ptr_item;
+ int i;
+ char option_name[64];
if (!infolist || !hotlist)
return 0;
@@ -463,6 +495,12 @@ gui_hotlist_add_to_infolist (struct t_infolist *infolist,
gui_color_get_name (CONFIG_COLOR(config_color_status_data_highlight))))
return 0;
break;
+ case GUI_HOTLIST_NUM_PRIORITIES:
+ /*
+ * this constant is used to count hotlist priorities only,
+ * it is never used as priority
+ */
+ break;
}
if (!infolist_new_var_buffer (ptr_item, "creation_time", &(hotlist->creation_time), sizeof (struct timeval)))
return 0;
@@ -474,6 +512,12 @@ gui_hotlist_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!infolist_new_var_string (ptr_item, "buffer_name", hotlist->buffer->name))
return 0;
+ for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
+ {
+ snprintf (option_name, sizeof (option_name), "count_%02d", i);
+ if (!infolist_new_var_integer (ptr_item, option_name, hotlist->count[i]))
+ return 0;
+ }
return 1;
}
@@ -486,6 +530,7 @@ void
gui_hotlist_print_log ()
{
struct t_gui_hotlist *ptr_hotlist;
+ int i;
for (ptr_hotlist = gui_hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist)
@@ -496,6 +541,10 @@ gui_hotlist_print_log ()
ptr_hotlist->creation_time.tv_sec,
ptr_hotlist->creation_time.tv_usec);
log_printf (" buffer . . . . . . . . : 0x%lx", ptr_hotlist->buffer);
+ for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
+ {
+ log_printf (" count[%02d]. . . . . . . : %d", i, ptr_hotlist->count[i]);
+ }
log_printf (" prev_hotlist . . . . . : 0x%lx", ptr_hotlist->prev_hotlist);
log_printf (" next_hotlist . . . . . : 0x%lx", ptr_hotlist->next_hotlist);
}
diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h
index fe87166e5..69ac2aed3 100644
--- a/src/gui/gui-hotlist.h
+++ b/src/gui/gui-hotlist.h
@@ -20,22 +20,28 @@
#ifndef __WEECHAT_GUI_HOTLIST_H
#define __WEECHAT_GUI_HOTLIST_H 1
-#define GUI_HOTLIST_LOW 0
-#define GUI_HOTLIST_MESSAGE 1
-#define GUI_HOTLIST_PRIVATE 2
-#define GUI_HOTLIST_HIGHLIGHT 3
+enum t_gui_hotlist_priority
+{
+ GUI_HOTLIST_LOW = 0,
+ GUI_HOTLIST_MESSAGE,
+ GUI_HOTLIST_PRIVATE,
+ GUI_HOTLIST_HIGHLIGHT,
+ /* number of priorities */
+ GUI_HOTLIST_NUM_PRIORITIES,
+};
-#define GUI_HOTLIST_MIN 0
-#define GUI_HOTLIST_MAX 3
+#define GUI_HOTLIST_MIN 0
+#define GUI_HOTLIST_MAX (GUI_HOTLIST_NUM_PRIORITIES - 1)
struct t_gui_hotlist
{
- int priority; /* 0=crappy msg (join/part), 1=msg, */
- /* 2=pv, 3=nick highlight */
- struct timeval creation_time; /* time when entry was added */
- struct t_gui_buffer *buffer; /* associated buffer */
- struct t_gui_hotlist *prev_hotlist;/* link to previous hotlist */
- struct t_gui_hotlist *next_hotlist;/* link to next hotlist */
+ enum t_gui_hotlist_priority priority; /* 0=crappy msg (join/part), */
+ /* 1=msg, 2=pv, 3=nick highlight */
+ struct timeval creation_time; /* time when entry was added */
+ struct t_gui_buffer *buffer; /* associated buffer */
+ int count[GUI_HOTLIST_NUM_PRIORITIES]; /* number of msgs by priority */
+ struct t_gui_hotlist *prev_hotlist; /* link to previous hotlist */
+ struct t_gui_hotlist *next_hotlist; /* link to next hotlist */
};
/* history variables */
@@ -47,9 +53,10 @@ extern int gui_add_hotlist;
/* hotlist functions */
-extern void gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
- struct timeval *creation_time,
- int allow_current_buffer);
+extern struct t_gui_hotlist *gui_hotlist_add (struct t_gui_buffer *buffer,
+ enum t_gui_hotlist_priority priority,
+ struct timeval *creation_time,
+ int allow_current_buffer);
extern void gui_hotlist_resort ();
extern void gui_hotlist_clear ();
extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer);
diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c
index 1f46457ea..9f020b620 100644
--- a/src/gui/gui-line.c
+++ b/src/gui/gui-line.c
@@ -738,6 +738,8 @@ gui_line_free_all (struct t_gui_buffer *buffer)
/*
* gui_line_get_notify_level: get notify level for a line
+ * return -1 if "notify_none" is found (no notify
+ * for line)
*/
int
@@ -747,6 +749,8 @@ gui_line_get_notify_level (struct t_gui_line *line)
for (i = 0; i < line->data->tags_count; i++)
{
+ if (string_strcasecmp (line->data->tags_array[i], "notify_none") == 0)
+ return -1;
if (string_strcasecmp (line->data->tags_array[i], "notify_highlight") == 0)
return GUI_HOTLIST_HIGHLIGHT;
if (string_strcasecmp (line->data->tags_array[i], "notify_private") == 0)
@@ -844,7 +848,7 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
{
if (new_line->data->highlight)
{
- gui_hotlist_add (buffer, GUI_HOTLIST_HIGHLIGHT, NULL, 1);
+ (void) gui_hotlist_add (buffer, GUI_HOTLIST_HIGHLIGHT, NULL, 1);
if (!weechat_upgrading)
{
message_for_signal = gui_chat_build_string_prefix_message (new_line);
@@ -871,7 +875,7 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
}
}
if (notify_level >= GUI_HOTLIST_MIN)
- gui_hotlist_add (buffer, notify_level, NULL, 1);
+ (void) gui_hotlist_add (buffer, notify_level, NULL, 1);
}
}
else
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 10463a63a..ca3b2acf7 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -944,18 +944,19 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
{
if (datetime != 0)
{
- weechat_printf_date_tags (buffer, datetime, "no_highlight",
+ weechat_printf_date_tags (buffer, datetime,
+ "no_highlight,notify_none",
"%s", pos_message + 1);
}
else
{
- weechat_printf_tags (buffer, "no_highlight",
+ weechat_printf_tags (buffer, "no_highlight,notify_none",
"%s", ptr_lines->data);
}
}
else
{
- weechat_printf_tags (buffer, "no_highlight",
+ weechat_printf_tags (buffer, "no_highlight,notify_none",
"%s", ptr_lines->data);
}
num_lines++;
@@ -965,9 +966,9 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
logger_tail_free (last_lines);
if (num_lines > 0)
{
- weechat_printf (buffer,
- _("===\t========== End of backlog (%d lines) =========="),
- num_lines);
+ weechat_printf_tags (buffer, "no_highlight,notify_none",
+ _("===\t========== End of backlog (%d lines) =========="),
+ num_lines);
weechat_buffer_set (buffer, "unread", "");
}
weechat_buffer_set (buffer, "print_hooks_enabled", "1");