Change livedata to reflect new, single method name

This commit is contained in:
Graham Hughes
2015-06-11 23:18:51 -07:00
parent 8264e7db37
commit 02304dd35d
2 changed files with 4 additions and 11 deletions

View File

@@ -214,7 +214,7 @@ var Connection = function (url, options) {
// Any message counts as receiving a pong, as it demonstrates that
// the server is still alive.
if (self._heartbeat) {
self._heartbeat.pongReceived();
self._heartbeat.messageReceived();
}
if (msg === null || !msg.msg) {
@@ -242,11 +242,8 @@ var Connection = function (url, options) {
options.onDDPVersionNegotiationFailure(description);
}
}
else if (msg.msg === 'ping') {
if (options.respondToPings)
self._send({msg: "pong", id: msg.id});
if (self._heartbeat)
self._heartbeat.pingReceived();
else if (msg.msg === 'ping' && options.respondToPings) {
self._send({msg: "pong", id: msg.id});
}
else if (msg.msg === 'pong') {
// noop, as we assume everything's a pong

View File

@@ -508,17 +508,13 @@ _.extend(Session.prototype, {
// the client is still alive.
if (self.heartbeat) {
Fiber(function () {
self.heartbeat.pongReceived();
self.heartbeat.messageReceived();
}).run();
}
if (self.version !== 'pre1' && msg_in.msg === 'ping') {
if (self._respondToPings)
self.send({msg: "pong", id: msg_in.id});
if (self.heartbeat)
Fiber(function () {
self.heartbeat.pingReceived();
}).run();
return;
}
if (self.version !== 'pre1' && msg_in.msg === 'pong') {