Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
a962fc0a
Commit
a962fc0a
authored
Jan 03, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't unnecessarily check for #publish-options
parent
cdd03822
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
dev.html
dev.html
+0
-1
dist/converse.js
dist/converse.js
+8
-2
src/converse-bookmarks.js
src/converse-bookmarks.js
+7
-5
No files found.
dev.html
View file @
a962fc0a
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
// websocket_url: 'ws://chat.example.org:5280/xmpp-websocket',
// websocket_url: 'ws://chat.example.org:5280/xmpp-websocket',
view_mode
:
'
fullscreen
'
,
view_mode
:
'
fullscreen
'
,
archived_messages_page_size
:
'
500
'
,
archived_messages_page_size
:
'
500
'
,
allow_public_bookmarks
:
true
,
notify_all_room_messages
:
[
notify_all_room_messages
:
[
'
discuss@conference.conversejs.org
'
'
discuss@conference.conversejs.org
'
],
],
...
...
dist/converse.js
View file @
a962fc0a
...
@@ -49007,8 +49007,14 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
...
@@ -49007,8 +49007,14 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
});
});
_converse.checkBookmarksSupport = async function () {
_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)]);
const identity = await _converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid);
return args[0] && (args[1].length || _converse.allow_public_bookmarks);
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() {
const initBookmarks = async function initBookmarks() {
src/converse-bookmarks.js
View file @
a962fc0a
...
@@ -523,11 +523,13 @@ converse.plugins.add('converse-bookmarks', {
...
@@ -523,11 +523,13 @@ converse.plugins.add('converse-bookmarks', {
});
});
_converse
.
checkBookmarksSupport
=
async
function
()
{
_converse
.
checkBookmarksSupport
=
async
function
()
{
const
args
=
await
Promise
.
all
([
const
identity
=
await
_converse
.
api
.
disco
.
getIdentity
(
'
pubsub
'
,
'
pep
'
,
_converse
.
bare_jid
);
_converse
.
api
.
disco
.
getIdentity
(
'
pubsub
'
,
'
pep
'
,
_converse
.
bare_jid
),
if
(
_converse
.
allow_public_bookmarks
)
{
_converse
.
api
.
disco
.
supports
(
Strophe
.
NS
.
PUBSUB
+
'
#publish-options
'
,
_converse
.
bare_jid
)
return
!!
identity
;
]);
}
else
{
return
args
[
0
]
&&
(
args
[
1
].
length
||
_converse
.
allow_public_bookmarks
);
const
supported
=
await
_converse
.
api
.
disco
.
supports
(
Strophe
.
NS
.
PUBSUB
+
'
#publish-options
'
,
_converse
.
bare_jid
);
return
!!
supported
.
length
;
}
}
}
const
initBookmarks
=
async
function
()
{
const
initBookmarks
=
async
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment