From 0dd5441f923d2b9a9e29e3b083dc3a4f61007302 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Thu, 14 Mar 2019 19:43:14 +0140 Subject: device_list iq should be from barejid or none Ensure we request device_list and remove non conforming handling of responses. Move initialisation of iq_handlers before call to sv_ev_login_account_success --- src/omemo/omemo.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/omemo') diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c index 5916ee8f..7850dad9 100644 --- a/src/omemo/omemo.c +++ b/src/omemo/omemo.c @@ -203,6 +203,8 @@ omemo_on_connect(ProfAccount *account) if (g_key_file_load_from_file(omemo_ctx.sessions_keyfile, omemo_ctx.sessions_filename->str, G_KEY_FILE_KEEP_COMMENTS, NULL)) { load_sessions(); } + + omemo_devicelist_subscribe(); } void @@ -368,13 +370,14 @@ omemo_prekeys(GList **prekeys, GList **ids, GList **lengths) void omemo_set_device_list(const char *const from, GList * device_list) { - Jid *jid = jid_create(from); + Jid *jid; + if (from) { + jid = jid_create(from); + } else { + jid = jid_create(connection_get_fulljid()); + } g_hash_table_insert(omemo_ctx.device_list, strdup(jid->barejid), device_list); - if (strchr(jid->barejid, '@') == NULL) { - // barejid is server so we should handle it as our own device list - g_hash_table_insert(omemo_ctx.device_list_handler, strdup(jid->barejid), handle_own_device_list); - } OmemoDeviceListHandler handler = g_hash_table_lookup(omemo_ctx.device_list_handler, jid->barejid); if (handler) { -- cgit 1.4.1-2-gfad0