Mercurial > xmpp-account-manager
comparison avatar.js @ 21:cd35420457ac
Also configure the avatar data node’s access model.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 23 Dec 2018 00:12:21 +0100 |
parents | 3eed9fe0bd7c |
children | 07e33207e598 |
comparison
equal
deleted
inserted
replaced
20:46660687924b | 21:cd35420457ac |
---|---|
177 return [bytes, unit]; | 177 return [bytes, unit]; |
178 } | 178 } |
179 | 179 |
180 avatar_access.addEventListener('change', function (evt) { | 180 avatar_access.addEventListener('change', function (evt) { |
181 const iq = configurePEPField('urn:xmpp:avatar:metadata', 'pubsub#access_model', evt.target.value); | 181 const iq = configurePEPField('urn:xmpp:avatar:metadata', 'pubsub#access_model', evt.target.value); |
182 connection.sendIQ(iq, onAvatarConfigured, onAvatarConfigureError.bind(null, 'PubSub configuration failed.')); | 182 connection.sendIQ(iq, onAvatarMetadataConfigured, onAvatarConfigureError.bind(null, 'PubSub configuration of metadata failed.')); |
183 displaySpinner(access_model_spinner_img); | 183 displaySpinner(access_model_spinner_img); |
184 }); | 184 }); |
185 | |
186 function onAvatarMetadataConfigured(result_iq) | |
187 { | |
188 const iq = configurePEPField('urn:xmpp:avatar:data', 'pubsub#access_model', evt.target.value); | |
189 connection.sendIQ(iq, onAvatarConfigured, onAvatarConfigureError.bind(null, 'PubSub configuration of data failed.')); | |
190 } | |
185 | 191 |
186 function onAvatarConfigured(result_iq) | 192 function onAvatarConfigured(result_iq) |
187 { | 193 { |
188 console.log('Successfully set avatar access model.') | 194 console.log('Successfully set avatar access model.') |
189 spinnerOk(access_model_spinner_img); | 195 spinnerOk(access_model_spinner_img); |