Commit 5949d294 authored by JC Brand's avatar JC Brand

omemo: specify pubsub item id of 'current'

parent 87b69c1d
...@@ -833,7 +833,7 @@ describe("The OMEMO module", function() { ...@@ -833,7 +833,7 @@ describe("The OMEMO module", function() {
`<iq from="romeo@montague.lit" id="${iq_stanza.getAttribute(`id`)}" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit" id="${iq_stanza.getAttribute(`id`)}" type="set" xmlns="jabber:client">`+
`<pubsub xmlns="http://jabber.org/protocol/pubsub">`+ `<pubsub xmlns="http://jabber.org/protocol/pubsub">`+
`<publish node="eu.siacs.conversations.axolotl.devicelist">`+ `<publish node="eu.siacs.conversations.axolotl.devicelist">`+
`<item>`+ `<item id="current">`+
`<list xmlns="eu.siacs.conversations.axolotl">`+ `<list xmlns="eu.siacs.conversations.axolotl">`+
`<device id="123456789"/>`+ `<device id="123456789"/>`+
`<device id="444"/>`+ `<device id="444"/>`+
...@@ -1139,7 +1139,7 @@ describe("The OMEMO module", function() { ...@@ -1139,7 +1139,7 @@ describe("The OMEMO module", function() {
`<iq from="romeo@montague.lit" id="${iq_stanza.getAttribute(`id`)}" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit" id="${iq_stanza.getAttribute(`id`)}" type="set" xmlns="jabber:client">`+
`<pubsub xmlns="http://jabber.org/protocol/pubsub">`+ `<pubsub xmlns="http://jabber.org/protocol/pubsub">`+
`<publish node="eu.siacs.conversations.axolotl.devicelist">`+ `<publish node="eu.siacs.conversations.axolotl.devicelist">`+
`<item>`+ `<item id="current">`+
`<list xmlns="eu.siacs.conversations.axolotl">`+ `<list xmlns="eu.siacs.conversations.axolotl">`+
`<device id="482886413b977930064a5888b92134fe"/>`+ `<device id="482886413b977930064a5888b92134fe"/>`+
`<device id="123456789"/>`+ `<device id="123456789"/>`+
......
...@@ -1181,7 +1181,7 @@ converse.plugins.add('converse-omemo', { ...@@ -1181,7 +1181,7 @@ converse.plugins.add('converse-omemo', {
* See: https://xmpp.org/extensions/xep-0384.html#usecases-announcing * See: https://xmpp.org/extensions/xep-0384.html#usecases-announcing
*/ */
publishDevices () { publishDevices () {
const item = $build('item').c('list', {'xmlns': Strophe.NS.OMEMO}) const item = $build('item', {'id': 'current'}).c('list', {'xmlns': Strophe.NS.OMEMO})
this.devices.filter(d => d.get('active')).forEach(d => item.c('device', {'id': d.get('id')}).up()); this.devices.filter(d => d.get('active')).forEach(d => item.c('device', {'id': d.get('id')}).up());
const options = {'pubsub#access_model': 'open'}; const options = {'pubsub#access_model': 'open'};
return api.pubsub.publish(null, Strophe.NS.OMEMO_DEVICELIST, item, options, false); return api.pubsub.publish(null, Strophe.NS.OMEMO_DEVICELIST, item, options, false);
......
...@@ -65,6 +65,7 @@ const device_list = (o) => { ...@@ -65,6 +65,7 @@ const device_list = (o) => {
} }
// TODO: this needs to go as a component into the OMEMO plugin folder
const omemo_page = (o) => { const omemo_page = (o) => {
const i18n_fingerprint = __("This device's OMEMO fingerprint"); const i18n_fingerprint = __("This device's OMEMO fingerprint");
const i18n_generate = __('Generate new keys and fingerprint'); const i18n_generate = __('Generate new keys and fingerprint');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment