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
a6567504
Commit
a6567504
authored
Jun 05, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only fetch presences when we're resuming an existing session.
updates #555
parent
a7184fab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
src/headless/converse-bosh.js
src/headless/converse-bosh.js
+0
-1
src/headless/converse-core.js
src/headless/converse-core.js
+10
-0
src/headless/converse-roster.js
src/headless/converse-roster.js
+6
-1
No files found.
src/headless/converse-bosh.js
View file @
a6567504
...
...
@@ -87,7 +87,6 @@ converse.plugins.add('converse-bosh', {
_converse
.
log
(
"
Could not restore session for jid:
"
+
jid
+
"
Error message:
"
+
e
.
message
,
Strophe
.
LogLevel
.
WARN
);
_converse
.
clearSession
();
// We want to clear presences (see #555)
return
false
;
}
}
...
...
src/headless/converse-core.js
View file @
a6567504
...
...
@@ -323,6 +323,16 @@ function isTestEnv () {
}
_converse
.
haveResumed
=
function
()
{
if
(
_converse
.
api
.
connection
.
isType
(
'
bosh
'
))
{
return
_converse
.
connfeedback
.
get
(
'
connection_status
'
)
===
Strophe
.
Status
.
ATTACHED
;
}
else
{
// XXX: Not binding means that the session was resumed.
// This seems very fragile. Perhaps a better way is possible.
return
!
_converse
.
connection
.
do_bind
;
}
}
_converse
.
isUniView
=
function
()
{
/* We distinguish between UniView and MultiView instances.
*
...
...
src/headless/converse-roster.js
View file @
a6567504
...
...
@@ -965,7 +965,12 @@ converse.plugins.add('converse-roster', {
}
_converse
.
presences
.
browserStorage
=
new
BrowserStorage
.
session
(
`converse.presences-
${
_converse
.
bare_jid
}
`
);
_converse
.
presences
.
fetch
();
if
(
_converse
.
haveResumed
())
{
_converse
.
presences
.
fetch
();
}
else
{
_converse
.
presences
.
browserStorage
.
_clear
();
}
/**
* Triggered once the _converse.Presences collection has been
* initialized and its cached data fetched.
...
...
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