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
0bd96bbc
Commit
0bd96bbc
authored
Feb 23, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Don't set xmppstatus' `jid` to null
parent
5278e4fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
src/converse-core.js
src/converse-core.js
+7
-2
src/converse-vcard.js
src/converse-vcard.js
+7
-11
No files found.
src/converse-core.js
View file @
0bd96bbc
...
...
@@ -1477,8 +1477,13 @@
this
.
connfeedback
=
new
this
.
ConnectionFeedback
();
this
.
XMPPStatus
=
Backbone
.
Model
.
extend
({
defaults
:
{
"
status
"
:
_converse
.
default_state
defaults
()
{
return
{
"
status
"
:
_converse
.
default_state
,
"
jid
"
:
_converse
.
bare_jid
,
"
vcard_updated
"
:
null
}
},
initialize
()
{
...
...
src/converse-vcard.js
View file @
0bd96bbc
...
...
@@ -11,6 +11,7 @@
}(
this
,
function
(
converse
)
{
"
use strict
"
;
const
{
Promise
,
Strophe
,
_
,
moment
,
sizzle
}
=
converse
.
env
;
const
u
=
converse
.
env
.
utils
;
function
onVCardData
(
_converse
,
jid
,
iq
,
callback
)
{
...
...
@@ -24,7 +25,7 @@
url
=
_
.
get
(
vcard
.
querySelector
(
'
URL
'
),
'
textContent
'
),
fullname
=
_
.
get
(
vcard
.
querySelector
(
'
FN
'
),
'
textContent
'
);
if
(
jid
)
{
if
(
!
u
.
isSameBareJID
(
jid
,
_converse
.
bare_jid
)
)
{
const
contact
=
_converse
.
roster
.
get
(
jid
);
if
(
contact
)
{
contact
.
save
({
...
...
@@ -39,8 +40,7 @@
if
(
callback
)
{
callback
({
'
stanza
'
:
iq
,
'
jid
'
:
jid
,
'
fullname
'
:
fullname
||
jid
,
'
fullname
'
:
fullname
,
'
image
'
:
img
,
'
image_type
'
:
img_type
,
'
url
'
:
url
...
...
@@ -63,16 +63,14 @@
* (String) jid - The Jabber ID of the user whose VCard
* is being requested.
*/
if
(
Strophe
.
getBareJidFromJid
(
jid
)
===
_converse
.
bare_jid
)
{
jid
=
null
;
// No 'to' attr when getting one's own vCard
}
const
to
=
Strophe
.
getBareJidFromJid
(
jid
)
===
_converse
.
bare_jid
?
null
:
jid
;
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
_converse
.
use_vcards
)
{
if
(
resolve
)
{
resolve
({
'
jid
'
:
jid
});
}
}
else
{
_converse
.
connection
.
vcard
.
get
(
_
.
partial
(
onVCardData
,
_converse
,
jid
,
_
,
resolve
),
jid
,
to
,
_
.
partial
(
onVCardError
,
_converse
,
jid
,
_
,
resolve
)
);
}
...
...
@@ -182,14 +180,12 @@
});
_converse
.
on
(
'
statusInitialized
'
,
function
fetchOwnVCard
()
{
if
(
_
.
isNil
(
_converse
.
xmppstatus
.
get
(
'
fullname
'
)))
{
if
(
_
.
isNil
(
_converse
.
xmppstatus
.
get
(
'
vcard_updated
'
)))
{
_converse
.
api
.
disco
.
supports
(
Strophe
.
NS
.
VCARD
,
_converse
.
domain
)
.
then
((
result
)
=>
{
if
(
result
.
supported
)
{
_converse
.
api
.
vcard
.
get
(
_converse
.
bare_jid
)
.
then
((
vcard
)
=>
{
_converse
.
xmppstatus
.
save
(
vcard
);
});
.
then
((
vcard
)
=>
_converse
.
xmppstatus
.
save
(
vcard
));
}})
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
}
...
...
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