Merge pull request #451 from matrix-org/dbkr/stop_peeking

Stop peeking when a matrix client is stopped
This commit is contained in:
David Baker
2017-06-05 14:16:35 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -2888,6 +2888,9 @@ MatrixClient.prototype.stopClient = function() {
this._syncApi.stop();
this._syncApi = null;
}
if (this._peekSync) {
this._peekSync.stopPeeking();
}
global.clearTimeout(this._checkTurnServersTimeoutID);
};
+4
View File
@@ -329,6 +329,10 @@ SyncApi.prototype._peekPoll = function(roomId, token) {
timeout: 30 * 1000,
from: token,
}, undefined, 50 * 1000).done(function(res) {
if (self._peekRoomId !== roomId) {
debuglog("Stopped peeking in room %s", roomId);
return;
}
// We have a problem that we get presence both from /events and /sync
// however, /sync only returns presence for users in rooms
// you're actually joined to.