From a8bf5eb7bab3941fb71d0b6f9bb847d695e9a218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 12 Mar 2017 20:52:20 +0100 Subject: core: add hotlist pointer in buffer structure --- doc/de/autogen/plugin_api/hdata.adoc | 1 + doc/en/autogen/plugin_api/hdata.adoc | 1 + doc/fr/autogen/plugin_api/hdata.adoc | 1 + doc/it/autogen/plugin_api/hdata.adoc | 1 + doc/ja/autogen/plugin_api/hdata.adoc | 1 + doc/pl/autogen/plugin_api/hdata.adoc | 1 + src/gui/gui-buffer.c | 3 +++ src/gui/gui-buffer.h | 3 ++- src/gui/gui-hotlist.c | 3 +++ 9 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/de/autogen/plugin_api/hdata.adoc b/doc/de/autogen/plugin_api/hdata.adoc index 51055935f..a73d1825c 100644 --- a/doc/de/autogen/plugin_api/hdata.adoc +++ b/doc/de/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/doc/en/autogen/plugin_api/hdata.adoc b/doc/en/autogen/plugin_api/hdata.adoc index d300036a2..df032ad11 100644 --- a/doc/en/autogen/plugin_api/hdata.adoc +++ b/doc/en/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/doc/fr/autogen/plugin_api/hdata.adoc b/doc/fr/autogen/plugin_api/hdata.adoc index 1df0d094a..9441a33f3 100644 --- a/doc/fr/autogen/plugin_api/hdata.adoc +++ b/doc/fr/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/doc/it/autogen/plugin_api/hdata.adoc b/doc/it/autogen/plugin_api/hdata.adoc index 43a0ae5f1..846334200 100644 --- a/doc/it/autogen/plugin_api/hdata.adoc +++ b/doc/it/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/doc/ja/autogen/plugin_api/hdata.adoc b/doc/ja/autogen/plugin_api/hdata.adoc index dc3f6f0f6..92365c7fa 100644 --- a/doc/ja/autogen/plugin_api/hdata.adoc +++ b/doc/ja/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/doc/pl/autogen/plugin_api/hdata.adoc b/doc/pl/autogen/plugin_api/hdata.adoc index 5ad640f03..b7b63ebe2 100644 --- a/doc/pl/autogen/plugin_api/hdata.adoc +++ b/doc/pl/autogen/plugin_api/hdata.adoc @@ -541,6 +541,7 @@ _highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restric _highlight_tags_   (string) + _highlight_tags_count_   (integer) + _highlight_tags_array_   (pointer, array_size: "highlight_tags_count") + +_hotlist_   (pointer, hdata: "hotlist") + _hotlist_max_level_nicks_   (hashtable) + _keys_   (pointer, hdata: "key") + _last_key_   (pointer, hdata: "key") + diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index d7fb5f828..54a52a2cf 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -709,6 +709,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin, new_buffer->highlight_tags_array = NULL; /* hotlist */ + new_buffer->hotlist = NULL; new_buffer->hotlist_max_level_nicks = hashtable_new ( 32, WEECHAT_HASHTABLE_STRING, @@ -4156,6 +4157,7 @@ gui_buffer_hdata_buffer_cb (const void *pointer, void *data, HDATA_VAR(struct t_gui_buffer, highlight_tags, STRING, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_tags_count, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_tags_array, POINTER, 0, "highlight_tags_count", NULL); + HDATA_VAR(struct t_gui_buffer, hotlist, POINTER, 0, NULL, "hotlist"); HDATA_VAR(struct t_gui_buffer, hotlist_max_level_nicks, HASHTABLE, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, keys, POINTER, 0, NULL, "key"); HDATA_VAR(struct t_gui_buffer, last_key, POINTER, 0, NULL, "key"); @@ -4571,6 +4573,7 @@ gui_buffer_print_log () log_printf (" highlight_tags. . . . . : '%s'", ptr_buffer->highlight_tags); log_printf (" highlight_tags_count. . : %d", ptr_buffer->highlight_tags_count); log_printf (" highlight_tags_array. . : 0x%lx", ptr_buffer->highlight_tags_array); + log_printf (" hotlist . . . . . . . . : 0x%lx", ptr_buffer->hotlist); log_printf (" keys. . . . . . . . . . : 0x%lx", ptr_buffer->keys); log_printf (" last_key. . . . . . . . : 0x%lx", ptr_buffer->last_key); log_printf (" keys_count. . . . . . . : %d", ptr_buffer->keys_count); diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h index 7bbd27982..1f009a88a 100644 --- a/src/gui/gui-buffer.h +++ b/src/gui/gui-buffer.h @@ -197,7 +197,8 @@ struct t_gui_buffer int highlight_tags_count; /* number of highlight tags */ char ***highlight_tags_array; /* array with highlight tags */ - /* hotlist settings for buffer */ + /* hotlist */ + struct t_gui_hotlist *hotlist; /* hotlist entry for buffer */ struct t_hashtable *hotlist_max_level_nicks; /* max hotlist level for */ /* some nicks */ diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 9bbcf65e0..86f118d35 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -99,6 +99,8 @@ gui_hotlist_free (struct t_gui_hotlist **hotlist, if (!ptr_hotlist) return; + ptr_hotlist->buffer->hotlist = NULL; + /* remove hotlist from queue */ if (*last_hotlist == ptr_hotlist) *last_hotlist = ptr_hotlist->prev_hotlist; @@ -405,6 +407,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, else gettimeofday (&(new_hotlist->creation_time), NULL); new_hotlist->buffer = buffer; + buffer->hotlist = new_hotlist; memcpy (new_hotlist->count, count, sizeof (new_hotlist->count)); new_hotlist->count[priority]++; new_hotlist->next_hotlist = NULL; -- cgit v1.2.3