# HG changeset patch # User Emmanuel Gil Peyrot # Date 1545441818 -3600 # Node ID 5aa1bf7154b0d206bc6e9c41376ad16c827f6d7e # Parent db033e5eabcb22a7298775aad096bdf81b79a80c Add a simple PEP node viewer and editor. diff --git a/avatar.js b/avatar.js --- 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.')); }); diff --git a/client.js b/client.js --- a/client.js +++ b/client.js @@ -95,6 +95,7 @@ document.addEventListener('DOMContentLoa function onConnected() { connected_div.hidden = false; + initPEP(connection); initNickname(connection); initAvatar(connection); } diff --git a/index.xhtml b/index.xhtml --- a/index.xhtml +++ b/index.xhtml @@ -62,6 +62,13 @@

+

PEP

+ + + + + +
PEP nodeTitleDescriptionType⚠️ Delete

Dangerous zone

@@ -98,6 +105,7 @@