diff options
author | Paul Fariello <paul@fariello.eu> | 2019-03-14 19:43:14 +0140 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2019-04-10 17:12:31 +0200 |
commit | 0dd5441f923d2b9a9e29e3b083dc3a4f61007302 (patch) | |
tree | 1d7489789c516b8f3f5ed0a1d437c2ae2ee841bb /src/omemo | |
parent | 6bb7deeb9c33c61a1bb880dd15d45185e27a48d5 (diff) | |
download | profani-tty-0dd5441f923d2b9a9e29e3b083dc3a4f61007302.tar.gz |
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
Diffstat (limited to 'src/omemo')
-rw-r--r-- | src/omemo/omemo.c | 13 |
1 files changed, 8 insertions, 5 deletions
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) { |