Commit a962fc0a authored by JC Brand's avatar JC Brand

Don't unnecessarily check for #publish-options

parent cdd03822
......@@ -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'
],
......
......@@ -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() {
......@@ -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 () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment