Mercurial > xmpp-account-manager
comparison util.js @ 52:2f45bee88b47
Add pubsub#access_model retrieval for the avatar node.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 23 May 2020 21:24:34 +0200 |
parents | 021185105e2f |
children | 6d861d881b96 |
comparison
equal
deleted
inserted
replaced
51:c27a4598ec44 | 52:2f45bee88b47 |
---|---|
69 if (text.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas' || text.localName !== 'text') | 69 if (text.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas' || text.localName !== 'text') |
70 return null; | 70 return null; |
71 return condition.localName + ': ' + text.textContent; | 71 return condition.localName + ': ' + text.textContent; |
72 } | 72 } |
73 | 73 |
74 function retrieveConfiguration(connection) | 74 function retrieveConfiguration(connection, node) |
75 { | 75 { |
76 return new Promise((resolve, reject) => { | 76 return new Promise((resolve, reject) => { |
77 const iq = $iq({type: 'get'}) | 77 const iq = $iq({type: 'get'}) |
78 .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub#owner'}) | 78 .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub#owner'}) |
79 .c('configure', {node: 'http://jabber.org/protocol/nick'}); | 79 .c('configure', {node: node}); |
80 connection.sendIQ(iq, onNodeConfigure.bind(null, resolve, reject), reject); | 80 connection.sendIQ(iq, onNodeConfigure.bind(null, resolve, reject), reject); |
81 }); | 81 }); |
82 } | 82 } |
83 | 83 |
84 function onNodeConfigure(resolve, reject, result_iq) | 84 function onNodeConfigure(resolve, reject, result_iq) |