From 0d8329b3a9b16cd6089810e61ce958fde00046b8 Mon Sep 17 00:00:00 2001 From: "Coren[m]" Date: Thu, 14 Nov 2013 19:05:36 +0100 Subject: Significantly trimmed down version of an ID<=>IP cache. Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving. --- toxcore/Messenger.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'toxcore/Messenger.c') diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 57cafc3f..49cffc98 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -26,9 +26,11 @@ #endif #include "Messenger.h" +#include "assoc.h" #include "network.h" #include "util.h" + #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -784,7 +786,7 @@ int add_groupchat(Messenger *m) for (i = 0; i < m->numchats; ++i) { if (m->chats[i] == NULL) { - Group_Chat *newchat = new_groupchat(m->net); + Group_Chat *newchat = new_groupchat(m->net, m->dht->assoc); if (newchat == NULL) return -1; @@ -803,7 +805,7 @@ int add_groupchat(Messenger *m) if (temp == NULL) return -1; - temp[m->numchats] = new_groupchat(m->net); + temp[m->numchats] = new_groupchat(m->net, m->dht->assoc); if (temp[m->numchats] == NULL) return -1; @@ -2006,6 +2008,9 @@ static int messenger_load_state_callback(void *outer, uint8_t *data, uint32_t le if (length == crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES + sizeof(uint32_t)) { set_nospam(&(m->fr), *(uint32_t *)data); load_keys(m->net_crypto, &data[sizeof(uint32_t)]); + + if (m->dht->assoc) + Assoc_self_client_id_changed(m->dht->assoc); } else return -1; /* critical */ -- cgit v1.2.3