about summary refs log tree commit diff stats
path: root/src/omemo
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-02-25 06:39:41 +0140
committerPaul Fariello <paul@fariello.eu>2019-04-10 16:03:50 +0200
commit1f9d46037cb86b26a7e91d924f41702a6ea58114 (patch)
tree58f7db5679803f81e6b5508f794eff375d1b52f6 /src/omemo
parent95da03ac28c283e59588bebf698b12aea2333c1f (diff)
downloadprofani-tty-1f9d46037cb86b26a7e91d924f41702a6ea58114.tar.gz
Request for device list when OMEMO is ready
Diffstat (limited to 'src/omemo')
-rw-r--r--src/omemo/omemo.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index 3ab044ee..e4926baa 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -83,14 +83,8 @@ omemo_generate_crypto_materials(ProfAccount *account)
     xmpp_ctx_t * const ctx = connection_get_ctx();
     char *barejid = xmpp_jid_bare(ctx, session_get_account_name());
 
-    GList *device_list = g_hash_table_lookup(omemo_ctx.device_list, barejid);
-    g_hash_table_steal(omemo_ctx.device_list, barejid);
-
     omemo_ctx.device_id = randombytes_uniform(0x80000000);
 
-    device_list = g_list_append(device_list, GINT_TO_POINTER(omemo_ctx.device_id));
-    g_hash_table_insert(omemo_ctx.device_list, strdup(barejid), device_list);
-
     signal_protocol_key_helper_generate_identity_key_pair(&omemo_ctx.identity_key_pair, omemo_ctx.signal);
     signal_protocol_key_helper_generate_registration_id(&omemo_ctx.registration_id, 0, omemo_ctx.signal);
     signal_protocol_key_helper_generate_pre_keys(&omemo_ctx.pre_keys_head, randombytes_random(), 100, omemo_ctx.signal);
@@ -102,7 +96,9 @@ omemo_generate_crypto_materials(ProfAccount *account)
 
     loaded = TRUE;
 
-    omemo_devicelist_publish(device_list);
+    /* Ensure we get our current device list, and it gets updated with our
+     * device_id */
+    omemo_devicelist_request(barejid);
     omemo_bundle_publish();
 }