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
b64b20c4
Commit
b64b20c4
authored
May 06, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
muc: fall back to finding occupant by nick
parent
1ddf1032
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
src/headless/converse-muc.js
src/headless/converse-muc.js
+19
-13
No files found.
src/headless/converse-muc.js
View file @
b64b20c4
...
...
@@ -2389,7 +2389,7 @@ converse.plugins.add('converse-muc', {
/**
* Represents a
n
participant in a MUC
* Represents a participant in a MUC
* @class
* @namespace _converse.ChatRoomOccupant
* @memberOf _converse
...
...
@@ -2440,6 +2440,12 @@ converse.plugins.add('converse-muc', {
});
/**
* A list of {@link _converse.ChatRoomOccupant} instances, representing participants in a MUC.
* @class
* @namespace _converse.ChatRoomOccupants
* @memberOf _converse
*/
_converse
.
ChatRoomOccupants
=
Collection
.
extend
({
model
:
_converse
.
ChatRoomOccupant
,
...
...
@@ -2502,20 +2508,20 @@ converse.plugins.add('converse-muc', {
api
.
trigger
(
'
membersFetched
'
);
},
/**
* Try to find an existing occupant based on the passed in
* data object.
*
* If we have a JID, we use that as lookup variable,
* otherwise we use the nick. We don't always have both,
* but should have at least one or the other.
* @private
* @method _converse.ChatRoomOccupants#findOccupant
* @param { Object } data
*/
findOccupant
(
data
)
{
/* Try to find an existing occupant based on the passed in
* data object.
*
* If we have a JID, we use that as lookup variable,
* otherwise we use the nick. We don't always have both,
* but should have at least one or the other.
*/
const
jid
=
Strophe
.
getBareJidFromJid
(
data
.
jid
);
if
(
jid
!==
null
)
{
return
this
.
findWhere
({
'
jid
'
:
jid
});
}
else
{
return
this
.
findWhere
({
'
nick
'
:
data
.
nick
});
}
return
(
jid
&&
this
.
findWhere
({
jid
}))
||
this
.
findWhere
({
'
nick
'
:
data
.
nick
});
}
});
...
...
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