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
8665c0ac
Commit
8665c0ac
authored
Mar 01, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in converse-ping. `this` was wrong context.
parent
bc42d50a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/converse-ping.js
src/converse-ping.js
+4
-4
No files found.
src/converse-ping.js
View file @
8665c0ac
...
@@ -32,12 +32,12 @@
...
@@ -32,12 +32,12 @@
// New functions which don't exist yet can also be added.
// New functions which don't exist yet can also be added.
onConnected
:
function
()
{
onConnected
:
function
()
{
this
.
_super
.
onConnected
().
done
(
this
.
registerPingHandler
);
this
.
_super
.
onConnected
().
done
(
converse
.
registerPingHandler
);
},
},
onReconnected
:
function
()
{
onReconnected
:
function
()
{
// We need to re-register the ping event handler on the newly
// We need to re-register the ping event handler on the newly
// created connection.
// created connection.
this
.
_super
.
onReconnected
().
done
(
this
.
registerPingHandler
);
this
.
_super
.
onReconnected
().
done
(
converse
.
registerPingHandler
);
}
}
},
},
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
converse
.
registerPongHandler
=
function
()
{
converse
.
registerPongHandler
=
function
()
{
converse
.
connection
.
disco
.
addFeature
(
Strophe
.
NS
.
PING
);
converse
.
connection
.
disco
.
addFeature
(
Strophe
.
NS
.
PING
);
converse
.
connection
.
ping
.
addPingHandler
(
this
.
pong
);
converse
.
connection
.
ping
.
addPingHandler
(
converse
.
pong
);
};
};
converse
.
registerPingHandler
=
function
()
{
converse
.
registerPingHandler
=
function
()
{
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
if
(
!
converse
.
lastStanzaDate
)
{
if
(
!
converse
.
lastStanzaDate
)
{
converse
.
lastStanzaDate
=
now
;
converse
.
lastStanzaDate
=
now
;
}
}
if
((
now
-
converse
.
lastStanzaDate
)
/
1000
>
this
.
ping_interval
)
{
if
((
now
-
converse
.
lastStanzaDate
)
/
1000
>
converse
.
ping_interval
)
{
return
converse
.
ping
();
return
converse
.
ping
();
}
}
return
true
;
return
true
;
...
...
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