From 1f9d46037cb86b26a7e91d924f41702a6ea58114 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Mon, 25 Feb 2019 06:39:41 +0140 Subject: Request for device list when OMEMO is ready --- src/omemo/omemo.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/omemo') 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(); } -- cgit 1.4.1-2-gfad0