|
|
|
@ -2614,12 +2614,15 @@ xmpp_stanza_t *omemo__encode(struct t_account *account, const char *jid,
|
|
|
|
|
|
|
|
|
|
int ret, keycount = 0;
|
|
|
|
|
signal_int_list *devicelist;
|
|
|
|
|
if ((ret = dls_load_devicelist(&devicelist, jid, omemo))) return NULL;
|
|
|
|
|
const char *target = jid;
|
|
|
|
|
for (int self = 0; self <= 1; self++)
|
|
|
|
|
{
|
|
|
|
|
if ((ret = dls_load_devicelist(&devicelist, target, omemo))) return NULL;
|
|
|
|
|
for (size_t i = 0; i < signal_int_list_size(devicelist); i++)
|
|
|
|
|
{
|
|
|
|
|
uint32_t device_id = signal_int_list_at(devicelist, i);
|
|
|
|
|
signal_protocol_address address = {
|
|
|
|
|
.name = jid, .name_len = strlen(jid), .device_id = device_id};
|
|
|
|
|
.name = target, .name_len = strlen(target), .device_id = device_id};
|
|
|
|
|
|
|
|
|
|
xmpp_stanza_t *header__key = xmpp_stanza_new(account->context);
|
|
|
|
|
xmpp_stanza_set_name(header__key, "key");
|
|
|
|
@ -2671,6 +2674,8 @@ xmpp_stanza_t *omemo__encode(struct t_account *account, const char *jid,
|
|
|
|
|
session_builder_free(builder);
|
|
|
|
|
}
|
|
|
|
|
signal_int_list_free(devicelist);
|
|
|
|
|
target = account_jid(account);
|
|
|
|
|
}
|
|
|
|
|
free(key_and_tag);
|
|
|
|
|
|
|
|
|
|
if (keycount == 0) return NULL;
|
|
|
|
|