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
e362776b
Commit
e362776b
authored
May 31, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converse-muc-views: Don't prematurely insert MUC into the DOM
parent
d86a657a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
spec/muc.js
spec/muc.js
+6
-5
src/converse-muc-views.js
src/converse-muc-views.js
+0
-1
No files found.
spec/muc.js
View file @
e362776b
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
);
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
);
expect
(
chatroomview
.
is_chatroom
).
toBeTruthy
();
expect
(
chatroomview
.
is_chatroom
).
toBeTruthy
();
expect
(
u
.
isVisible
(
chatroomview
.
el
)).
toBeTruthy
(
);
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
chatroomview
.
el
)
);
// Test again, now that the room exists.
// Test again, now that the room exists.
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
...
@@ -129,19 +129,19 @@
...
@@ -129,19 +129,19 @@
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
expect
(
u
.
isVisible
(
chatroomview
.
el
)).
toBeTruthy
(
);
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
chatroomview
.
el
)
);
jid
=
'
leisure@localhost
'
;
jid
=
'
leisure@localhost
'
;
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
expect
(
u
.
isVisible
(
chatroomview
.
el
)).
toBeTruthy
(
);
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
chatroomview
.
el
)
);
jid
=
'
leiSure@localhost
'
;
jid
=
'
leiSure@localhost
'
;
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
room
=
await
_converse
.
api
.
rooms
.
open
(
jid
);
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
expect
(
room
instanceof
Backbone
.
Model
).
toBeTruthy
();
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
chatroomview
=
_converse
.
chatboxviews
.
get
(
jid
.
toLowerCase
());
expect
(
u
.
isVisible
(
chatroomview
.
el
)).
toBeTruthy
(
);
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
chatroomview
.
el
)
);
chatroomview
.
close
();
chatroomview
.
close
();
_converse
.
muc_instant_rooms
=
false
;
_converse
.
muc_instant_rooms
=
false
;
...
@@ -1286,6 +1286,7 @@
...
@@ -1286,6 +1286,7 @@
await
_converse
.
api
.
rooms
.
open
(
'
coven@chat.shakespeare.lit
'
,
{
'
nick
'
:
'
some1
'
});
await
_converse
.
api
.
rooms
.
open
(
'
coven@chat.shakespeare.lit
'
,
{
'
nick
'
:
'
some1
'
});
const
view
=
_converse
.
chatboxviews
.
get
(
'
coven@chat.shakespeare.lit
'
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
coven@chat.shakespeare.lit
'
);
await
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
view
.
el
));
spyOn
(
view
.
model
,
'
saveAffiliationAndRole
'
).
and
.
callThrough
();
spyOn
(
view
.
model
,
'
saveAffiliationAndRole
'
).
and
.
callThrough
();
// We pretend this is a new room, so no disco info is returned.
// We pretend this is a new room, so no disco info is returned.
const
features_stanza
=
$iq
({
const
features_stanza
=
$iq
({
...
@@ -1305,7 +1306,7 @@
...
@@ -1305,7 +1306,7 @@
* </x>
* </x>
* </presence></body>
* </presence></body>
*/
*/
var
presence
=
$pres
({
const
presence
=
$pres
({
to
:
'
dummy@localhost/_converse.js-29092160
'
,
to
:
'
dummy@localhost/_converse.js-29092160
'
,
from
:
'
coven@chat.shakespeare.lit/some1
'
from
:
'
coven@chat.shakespeare.lit/some1
'
}).
c
(
'
x
'
,
{
xmlns
:
Strophe
.
NS
.
MUC_USER
})
}).
c
(
'
x
'
,
{
xmlns
:
Strophe
.
NS
.
MUC_USER
})
...
...
src/converse-muc-views.js
View file @
e362776b
...
@@ -581,7 +581,6 @@ converse.plugins.add('converse-muc-views', {
...
@@ -581,7 +581,6 @@ converse.plugins.add('converse-muc-views', {
this
.
render
();
this
.
render
();
this
.
updateAfterMessagesFetched
();
this
.
updateAfterMessagesFetched
();
this
.
createOccupantsView
();
this
.
createOccupantsView
();
this
.
insertIntoDOM
();
this
.
registerHandlers
();
this
.
registerHandlers
();
/**
/**
* Triggered once a groupchat has been opened
* Triggered once a groupchat has been opened
...
...
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