nicks hash moved to peer_number keys

This commit is contained in:
Gordon Quad 2016-12-04 22:50:53 +00:00
parent ad2a727a91
commit 56c0c924ac
4 changed files with 37 additions and 64 deletions

View file

@ -45,25 +45,6 @@ twc_chat_buffer_close_callback(const void *pointer,
void *data,
struct t_gui_buffer *weechat_buffer);
/**
* Hash a Tox ID for the nicklist hashtable in group chat objects.
*/
unsigned long long
twc_tox_id_hash_callback(struct t_hashtable *hashtable, const void *key)
{
return twc_hash_tox_id(key);
}
/**
* Compare two Tox IDs for the nicklist hashtable in group chat objects.
*/
int
twc_tox_id_compare_callback(struct t_hashtable *hashtable,
const void *id1, const void *id2)
{
return memcmp(id1, id2, TOX_PUBLIC_KEY_SIZE);
}
/**
* Create a new chat.
*/
@ -137,10 +118,10 @@ twc_chat_new_group(struct t_twc_profile *profile, int32_t group_number)
chat->nicklist_group = weechat_nicklist_add_group(chat->buffer, NULL,
NULL, NULL, true);
chat->nicks = weechat_hashtable_new(32,
WEECHAT_HASHTABLE_BUFFER,
WEECHAT_HASHTABLE_INTEGER,
WEECHAT_HASHTABLE_POINTER,
twc_tox_id_hash_callback,
twc_tox_id_compare_callback);
NULL,
NULL);
weechat_buffer_set(chat->buffer, "nicklist", "1");
}