1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

only consider rooms when paginating EventTimelines with rooms

This commit is contained in:
Matthew Hodgson
2016-09-09 18:05:43 +01:00
parent bd9e3e5794
commit ad7db78829

View File

@@ -1704,11 +1704,6 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
}
}
var room = this.getRoom(eventTimeline.getRoomId());
if (!room) {
throw new Error("Unknown room " + eventTimeline.getRoomId());
}
var dir = backwards ? EventTimeline.BACKWARDS : EventTimeline.FORWARDS;
var token = eventTimeline.getPaginationToken(dir);
@@ -1766,6 +1761,11 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
eventTimeline._paginationRequests[dir] = promise;
}
else {
var room = this.getRoom(eventTimeline.getRoomId());
if (!room) {
throw new Error("Unknown room " + eventTimeline.getRoomId());
}
var path = utils.encodeUri(
"/rooms/$roomId/messages", {$roomId: eventTimeline.getRoomId()}
);