1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Add support for missing from in bundle iq

This commit is contained in:
Paul Fariello 2019-03-29 13:54:21 +01:00
parent 562302846a
commit 0d0e2b246a

View File

@ -107,9 +107,14 @@ omemo_bundle_request(const char * const jid, uint32_t device_id, ProfIqCallback
int int
omemo_start_device_session_handle_bundle(xmpp_stanza_t *const stanza, void *const userdata) omemo_start_device_session_handle_bundle(xmpp_stanza_t *const stanza, void *const userdata)
{ {
const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); char *from = NULL;
if (!from) { const char *from_attr = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
return 1; if (!from_attr) {
Jid *jid = jid_create(connection_get_fulljid());
from = strdup(jid->barejid);
jid_destroy(jid);
} else {
from = strdup(from_attr);
} }
if (g_strcmp0(from, userdata) != 0) { if (g_strcmp0(from, userdata) != 0) {
@ -219,6 +224,7 @@ omemo_start_device_session_handle_bundle(xmpp_stanza_t *const stanza, void *cons
signed_prekey_raw, signed_prekey_len, signed_prekey_signature_raw, signed_prekey_raw, signed_prekey_len, signed_prekey_signature_raw,
signed_prekey_signature_len, identity_key_raw, identity_key_len); signed_prekey_signature_len, identity_key_raw, identity_key_len);
free(from);
g_list_free_full(prekeys_list, (GDestroyNotify)omemo_key_free); g_list_free_full(prekeys_list, (GDestroyNotify)omemo_key_free);
g_free(signed_prekey_raw); g_free(signed_prekey_raw);
g_free(identity_key_raw); g_free(identity_key_raw);