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
9f0dfcdb
Commit
9f0dfcdb
authored
Aug 24, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait before firing `roomsAutoJoined` event
parent
f7ef334f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
src/headless/converse-muc.js
src/headless/converse-muc.js
+13
-14
No files found.
src/headless/converse-muc.js
View file @
9f0dfcdb
...
...
@@ -2652,25 +2652,24 @@ converse.plugins.add('converse-muc', {
return
api
.
rooms
.
get
(
jid
,
attrs
,
true
);
};
/**
* Automatically join groupchats, based on the
/* Automatically join groupchats, based on the
* "auto_join_rooms" configuration setting, which is an array
* of strings (groupchat JIDs) or objects (with groupchat JID and other
* settings).
* of strings (groupchat JIDs) or objects (with groupchat JID and other settings).
*/
function
autoJoinRooms
()
{
a
pi
.
settings
.
get
(
'
auto_join_rooms
'
).
forEach
(
groupchat
=>
{
if
(
isString
(
groupchat
))
{
if
(
_converse
.
chatboxes
.
where
({
'
jid
'
:
groupchat
}).
length
)
{
return
;
async
function
autoJoinRooms
()
{
a
wait
Promise
.
all
(
api
.
settings
.
get
(
'
auto_join_rooms
'
).
map
(
muc
=>
{
if
(
isString
(
muc
))
{
if
(
_converse
.
chatboxes
.
where
({
'
jid
'
:
muc
}).
length
)
{
return
Promise
.
resolve
()
;
}
api
.
rooms
.
open
(
groupchat
);
}
else
if
(
isObject
(
groupchat
))
{
api
.
rooms
.
open
(
groupchat
.
jid
,
clone
(
groupchat
));
return
api
.
rooms
.
open
(
muc
);
}
else
if
(
isObject
(
muc
))
{
return
api
.
rooms
.
open
(
muc
.
jid
,
clone
(
muc
));
}
else
{
log
.
error
(
'
Invalid groupchat criteria specified for "auto_join_rooms"
'
);
log
.
error
(
'
Invalid muc criteria specified for "auto_join_rooms"
'
);
return
Promise
.
resolve
();
}
});
})
)
;
/**
* Triggered once any rooms that have been configured to be automatically joined,
* specified via the _`auto_join_rooms` setting, have been entered.
...
...
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