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
ceb9d129
Commit
ceb9d129
authored
May 15, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't store ChatRoomOccupants on ChatRoomView
Helps with enforcing discipline of keeping them separate
parent
7cd69726
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
spec/muc.js
spec/muc.js
+7
-8
src/converse-muc-views.js
src/converse-muc-views.js
+2
-2
No files found.
spec/muc.js
View file @
ceb9d129
...
...
@@ -1432,8 +1432,8 @@
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
var
name
;
var
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@localhost
'
),
occupants
=
view
.
el
.
querySelector
(
'
.occupant-list
'
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
const
occupants
=
view
.
el
.
querySelector
(
'
.occupant-list
'
);
var
presence
,
role
,
jid
,
model
;
for
(
var
i
=
0
;
i
<
mock
.
chatroom_names
.
length
;
i
++
)
{
name
=
mock
.
chatroom_names
[
i
];
...
...
@@ -1452,8 +1452,8 @@
.
c
(
'
status
'
).
attrs
({
code
:
'
110
'
}).
nodeTree
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
occupants
.
querySelectorAll
(
'
li
'
).
length
).
toBe
(
2
+
i
);
model
=
view
.
occupantsview
.
model
.
where
({
'
nick
'
:
name
})[
0
];
var
index
=
view
.
occupantsview
.
model
.
indexOf
(
model
);
model
=
view
.
model
.
occupants
.
where
({
'
nick
'
:
name
})[
0
];
const
index
=
view
.
model
.
occupants
.
indexOf
(
model
);
expect
(
occupants
.
querySelectorAll
(
'
li .occupant-nick
'
)[
index
].
textContent
.
trim
()).
toBe
(
mock
.
chatroom_names
[
i
]);
}
...
...
@@ -1506,8 +1506,8 @@
.
c
(
'
status
'
).
attrs
({
code
:
'
110
'
}).
nodeTree
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
occupants
.
querySelectorAll
(
'
li
'
).
length
).
toBe
(
2
+
i
);
model
=
view
.
occupantsview
.
model
.
where
({
'
nick
'
:
name
})[
0
];
var
index
=
view
.
occupantsview
.
model
.
indexOf
(
model
);
model
=
view
.
model
.
occupants
.
where
({
'
nick
'
:
name
})[
0
];
const
index
=
view
.
model
.
occupants
.
indexOf
(
model
);
expect
(
occupants
.
querySelectorAll
(
'
li .occupant-nick
'
)[
index
].
textContent
.
trim
()).
toBe
(
mock
.
chatroom_names
[
i
]);
}
...
...
@@ -1801,8 +1801,7 @@
spyOn
(
_converse
.
connection
,
'
send
'
).
and
.
callFake
(
function
(
stanza
)
{
sent_stanza
=
stanza
;
});
const
results_el
=
view
.
occupantsview
.
el
.
querySelector
(
'
.suggestion-box__results
'
);
const
hint
=
results_el
.
firstElementChild
;
const
hint
=
await
test_utils
.
waitUntil
(()
=>
view
.
el
.
querySelector
(
'
.suggestion-box__results li
'
));
expect
(
input
.
value
).
toBe
(
'
Felix
'
);
expect
(
hint
.
textContent
).
toBe
(
'
Felix Amsel
'
);
...
...
src/converse-muc-views.js
View file @
ceb9d129
...
...
@@ -637,9 +637,9 @@ converse.plugins.add('converse-muc-views', {
createOccupantsView
()
{
this
.
model
.
occupants
.
chatroomview
=
this
;
this
.
occupants
view
=
new
_converse
.
ChatRoomOccupantsView
({
'
model
'
:
this
.
model
.
occupants
});
const
view
=
new
_converse
.
ChatRoomOccupantsView
({
'
model
'
:
this
.
model
.
occupants
});
const
container_el
=
this
.
el
.
querySelector
(
'
.chatroom-body
'
);
container_el
.
insertAdjacentElement
(
'
beforeend
'
,
this
.
occupants
view
.
el
);
container_el
.
insertAdjacentElement
(
'
beforeend
'
,
view
.
el
);
},
initMentionAutoComplete
()
{
...
...
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