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
ab4d0204
Commit
ab4d0204
authored
May 25, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update all vcards that might be associated with an occupant
parent
d920c2a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
src/converse-muc.js
src/converse-muc.js
+11
-5
src/converse-vcard.js
src/converse-vcard.js
+1
-1
No files found.
src/converse-muc.js
View file @
ab4d0204
...
@@ -985,13 +985,18 @@
...
@@ -985,13 +985,18 @@
},
},
onAvatarChanged
()
{
onAvatarChanged
()
{
const
vcard
=
_converse
.
vcards
.
findWhere
({
'
jid
'
:
this
.
get
(
'
from
'
)});
if
(
!
vcard
)
{
return
;
}
const
hash
=
this
.
get
(
'
image_hash
'
);
const
hash
=
this
.
get
(
'
image_hash
'
);
if
(
hash
&&
vcard
.
get
(
'
image_hash
'
)
!==
hash
)
{
const
vcards
=
[];
_converse
.
api
.
vcard
.
update
(
vcard
);
if
(
this
.
get
(
'
jid
'
))
{
vcards
.
push
(
this
.
updateVCard
(
_converse
.
vcards
.
findWhere
({
'
jid
'
:
this
.
get
(
'
jid
'
)})));
}
}
vcards
.
push
(
this
.
updateVCard
(
_converse
.
vcards
.
findWhere
({
'
jid
'
:
this
.
get
(
'
from
'
)})));
_
.
forEach
(
_
.
filter
(
vcards
,
undefined
),
(
vcard
)
=>
{
if
(
hash
&&
vcard
.
get
(
'
image_hash
'
)
!==
hash
)
{
_converse
.
api
.
vcard
.
update
(
vcard
);
}
});
},
},
getDisplayName
()
{
getDisplayName
()
{
...
@@ -1032,6 +1037,7 @@
...
@@ -1032,6 +1037,7 @@
// Remove absent occupants who've been removed from
// Remove absent occupants who've been removed from
// the members lists.
// the members lists.
const
occupant
=
this
.
findOccupant
({
'
jid
'
:
removed_jid
});
const
occupant
=
this
.
findOccupant
({
'
jid
'
:
removed_jid
});
if
(
!
occupant
)
{
return
;
}
if
(
occupant
.
get
(
'
show
'
)
===
'
offline
'
)
{
if
(
occupant
.
get
(
'
show
'
)
===
'
offline
'
)
{
occupant
.
destroy
();
occupant
.
destroy
();
}
}
...
...
src/converse-vcard.js
View file @
ab4d0204
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
if
(
_
.
isString
(
model
))
{
if
(
_
.
isString
(
model
))
{
return
getVCard
(
_converse
,
model
);
return
getVCard
(
_converse
,
model
);
}
else
if
(
!
model
.
get
(
'
vcard_updated
'
)
||
force
)
{
}
else
if
(
!
model
.
get
(
'
vcard_updated
'
)
||
force
)
{
const
jid
=
model
.
get
(
'
jid
'
)
||
model
.
get
(
'
muc_jid
'
)
;
const
jid
=
model
.
get
(
'
jid
'
);
if
(
!
jid
)
{
if
(
!
jid
)
{
throw
new
Error
(
"
No JID to get vcard for!
"
);
throw
new
Error
(
"
No JID to get vcard for!
"
);
}
}
...
...
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