summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index c2971a70..19bd7edf 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -26,9 +26,11 @@
26#endif 26#endif
27 27
28#include "Messenger.h" 28#include "Messenger.h"
29#include "assoc.h"
29#include "network.h" 30#include "network.h"
30#include "util.h" 31#include "util.h"
31 32
33
32#define MIN(a,b) (((a)<(b))?(a):(b)) 34#define MIN(a,b) (((a)<(b))?(a):(b))
33 35
34 36
@@ -1820,6 +1822,18 @@ void do_messenger(Messenger *m)
1820 1822
1821 if (unix_time() > lastdump + DUMPING_CLIENTS_FRIENDS_EVERY_N_SECONDS) { 1823 if (unix_time() > lastdump + DUMPING_CLIENTS_FRIENDS_EVERY_N_SECONDS) {
1822 loglog(" = = = = = = = = \n"); 1824 loglog(" = = = = = = = = \n");
1825 Assoc_status(m->dht->assoc);
1826
1827 if (m->numchats > 0) {
1828 size_t c;
1829
1830 for (c = 0; c < m->numchats; c++) {
1831 loglog("---------------- \n");
1832 Assoc_status(m->chats[c]->assoc);
1833 }
1834 }
1835
1836 loglog(" = = = = = = = = \n");
1823 1837
1824 lastdump = unix_time(); 1838 lastdump = unix_time();
1825 uint32_t client, last_pinged; 1839 uint32_t client, last_pinged;
@@ -2007,6 +2021,9 @@ static int messenger_load_state_callback(void *outer, uint8_t *data, uint32_t le
2007 if (length == crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES + sizeof(uint32_t)) { 2021 if (length == crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES + sizeof(uint32_t)) {
2008 set_nospam(&(m->fr), *(uint32_t *)data); 2022 set_nospam(&(m->fr), *(uint32_t *)data);
2009 load_keys(m->net_crypto, &data[sizeof(uint32_t)]); 2023 load_keys(m->net_crypto, &data[sizeof(uint32_t)]);
2024
2025 if (m->dht->assoc)
2026 Assoc_self_client_id_changed(m->dht->assoc, m->net_crypto->self_public_key);
2010 } else 2027 } else
2011 return -1; /* critical */ 2028 return -1; /* critical */
2012 2029