Don't unnecessarily check for #publish-options

This commit is contained in:
JC Brand 2019-01-03 13:49:33 +01:00
parent cdd0382241
commit a962fc0a24
3 changed files with 15 additions and 8 deletions

View File

@ -28,7 +28,6 @@
// websocket_url: 'ws://chat.example.org:5280/xmpp-websocket',
view_mode: 'fullscreen',
archived_messages_page_size: '500',
allow_public_bookmarks: true,
notify_all_room_messages: [
'discuss@conference.conversejs.org'
],

10
dist/converse.js vendored
View File

@ -49007,8 +49007,14 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
});
_converse.checkBookmarksSupport = async function () {
const args = await Promise.all([_converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid), _converse.api.disco.supports(Strophe.NS.PUBSUB + '#publish-options', _converse.bare_jid)]);
return args[0] && (args[1].length || _converse.allow_public_bookmarks);
const identity = await _converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid);
if (_converse.allow_public_bookmarks) {
return !!identity;
} else {
const supported = await _converse.api.disco.supports(Strophe.NS.PUBSUB + '#publish-options', _converse.bare_jid);
return !!supported.length;
}
};
const initBookmarks = async function initBookmarks() {

View File

@ -523,11 +523,13 @@ converse.plugins.add('converse-bookmarks', {
});
_converse.checkBookmarksSupport = async function () {
const args = await Promise.all([
_converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid),
_converse.api.disco.supports(Strophe.NS.PUBSUB+'#publish-options', _converse.bare_jid)
]);
return args[0] && (args[1].length || _converse.allow_public_bookmarks);
const identity = await _converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid);
if (_converse.allow_public_bookmarks) {
return !!identity;
} else {
const supported = await _converse.api.disco.supports(Strophe.NS.PUBSUB+'#publish-options', _converse.bare_jid);
return !!supported.length;
}
}
const initBookmarks = async function () {