core: add hotlist pointer in buffer structure

This commit is contained in:
Sébastien Helleu 2017-03-12 20:52:20 +01:00
parent 4ef8e61ca5
commit a8bf5eb7ba
9 changed files with 14 additions and 1 deletions

View File

@ -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") +

View File

@ -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") +

View File

@ -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") +

View File

@ -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") +

View File

@ -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") +

View File

@ -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") +

View File

@ -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);

View File

@ -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 */

View File

@ -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;