Mercurial > xmpp-account-manager
diff avatar.js @ 3:5aa1bf7154b0
Add a simple PEP node viewer and editor.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 22 Dec 2018 02:23:38 +0100 |
parents | db033e5eabcb |
children | aedf80eefc19 |
line wrap: on
line diff
--- a/avatar.js +++ b/avatar.js @@ -171,20 +171,7 @@ function initAvatar(connection) { } avatar_access.addEventListener('change', function (evt) { - const iq = $iq({type: 'set'}) - .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub#owner'}) - .c('configure', {node: 'urn:xmpp:avatar:metadata'}) - .c('x', {xmlns: 'jabber:x:data', type: 'submit'}) - .c('field', {'var': 'FORM_TYPE', type: 'hidden'}) - .c('value') - .t('http://jabber.org/protocol/pubsub#node_config') - .up() - .up() - .c('field', {'var': 'pubsub#access_model'}) - .c('value') - .t(evt.target.value) - .up() - .up() + const iq = configurePEPField('urn:xmpp:avatar:metadata', 'pubsub#access_model', evt.target.value); connection.sendIQ(iq, onAvatarConfigured, onAvatarConfigureError.bind(null, 'PubSub configuration failed.')); });