summaryrefslogtreecommitdiff
path: root/src/gui/gui-hotlist.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-06-17 16:01:09 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-06-17 16:01:09 +0200
commitaf87798455e9d82773094a3c274ecb991af41ed9 (patch)
tree32de00c475b9f127003d6e663d6e8f98f13ad3ad /src/gui/gui-hotlist.c
parent860842240b2c3f673a2265716359cb6605048386 (diff)
downloadweechat-af87798455e9d82773094a3c274ecb991af41ed9.zip
New plugin "notify", new option for debug messages in plugins
Diffstat (limited to 'src/gui/gui-hotlist.c')
-rw-r--r--src/gui/gui-hotlist.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index 01fcac6ad..8f5c559a0 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -65,6 +65,30 @@ gui_hotlist_search (struct t_gui_hotlist *hotlist, struct t_gui_buffer *buffer)
}
/*
+ * gui_hotlist_check_buffer_notify: return: 1 if buffer notify is ok according
+ * to priority (buffer will be added
+ * to hotlist)
+ * 0 if buffer will not be added to
+ * hotlist
+ */
+
+int
+gui_hotlist_check_buffer_notify (struct t_gui_buffer *buffer, int priority)
+{
+ switch (priority)
+ {
+ case GUI_HOTLIST_LOW:
+ return (buffer->notify >= 3);
+ case GUI_HOTLIST_MESSAGE:
+ case GUI_HOTLIST_PRIVATE:
+ return (buffer->notify >= 2);
+ case GUI_HOTLIST_HIGHLIGHT:
+ return (buffer->notify >= 1);
+ }
+ return 1;
+}
+
+/*
* gui_hotlist_find_pos: find position for a inserting in hotlist
* (for sorting hotlist)
*/
@@ -208,6 +232,10 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
else 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;
+
if ((ptr_hotlist = gui_hotlist_search (gui_hotlist, buffer)))
{
/* return if priority is greater or equal than the one to add */