Add a <store> hint to OMEMO messages.

updates #497
This commit is contained in:
JC Brand 2018-08-27 16:44:19 +02:00
parent 15a4bcd11e
commit 3e7c8655ad
2 changed files with 7 additions and 11 deletions

View File

@ -194,6 +194,7 @@
`</header>`+
`<payload>${sent_stanza.nodeTree.querySelector('payload').textContent}</payload>`+
`</encrypted>`+
`<store xmlns='urn:xmpp:hints'/>`+
`</message>`);
// Test reception of an encrypted message
@ -327,15 +328,6 @@
}));
it("will add processing hints to sent out encrypted <message> stanzas",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
// TODO
done();
}));
it("updates device lists based on PEP messages",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},

View File

@ -410,8 +410,12 @@
.map(device => this.encryptKey(obj.key_and_tag, device));
return Promise.all(promises)
.then((dicts) => this.addKeysToMessageStanza(stanza, dicts, obj.iv))
.then((stanza) => stanza.c('payload').t(obj.payload))
.then(dicts => this.addKeysToMessageStanza(stanza, dicts, obj.iv))
.then(stanza => {
stanza.c('payload').t(obj.payload).up().up();
stanza.c('store', {'xmlns': Strophe.NS.HINTS});
return stanza;
});
});
},