From 6c7d13f8ce86a7a9538cf369e108a2c65a4c1d77 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 18 Mar 2016 19:22:34 +0000 Subject: [PATCH 1/2] API to stop peeking --- lib/client.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/client.js b/lib/client.js index ad607a5b3..a1ada870b 100644 --- a/lib/client.js +++ b/lib/client.js @@ -2317,6 +2317,16 @@ MatrixClient.prototype.peekInRoom = function(roomId) { return this._peekSync.peek(roomId); }; +/** + * Stop any ongoing room peeking. + */ +MatrixClient.prototype.stopPeeking = function(roomId) { + if (this._peekSync) { + this._peekSync.stopPeeking(); + this._peekSync = null; + } +}; + /** * Set r/w flags for guest access in a room. * @param {string} roomId The room to configure guest access in. From d29302716da9950ec02d6ec82deb921b51987556 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 18 Mar 2016 19:25:22 +0000 Subject: [PATCH 2/2] oops --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index a1ada870b..169872dff 100644 --- a/lib/client.js +++ b/lib/client.js @@ -2320,7 +2320,7 @@ MatrixClient.prototype.peekInRoom = function(roomId) { /** * Stop any ongoing room peeking. */ -MatrixClient.prototype.stopPeeking = function(roomId) { +MatrixClient.prototype.stopPeeking = function() { if (this._peekSync) { this._peekSync.stopPeeking(); this._peekSync = null;