1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-18 05:42:00 +03:00

Implement peek syncing.

This involves hitting room initial sync then /events?room_id=!thing:here
It even works.
This commit is contained in:
Kegan Dougal
2016-01-07 14:58:28 +00:00
parent d36c928d95
commit cdb4bc5107
2 changed files with 81 additions and 1 deletions

View File

@@ -1943,13 +1943,15 @@ MatrixClient.prototype.registerGuest = function(opts, callback) {
* Peek into a room and receive updates about the room. This only works if the
* history visibility for the room is world_readable.
* @param {String} roomId The room to attempt to peek into.
* @return {module:client.Promise} Resolves: Room object
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.peekInRoom = function(roomId) {
if (this._peekSync) {
this._peekSync.stopPeeking();
}
this._peekSync = new SyncApi(this);
this._peekSync.peek(roomId);
return this._peekSync.peek(roomId);
};
/**