1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00
This commit is contained in:
Matthew Hodgson
2016-09-10 00:58:16 +01:00
parent b69f6cf70a
commit 0713e65fc5

View File

@@ -1719,9 +1719,12 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
return pendingRequest;
}
var path, params, promise;
var self = this;
if (isNotifTimeline) {
var path = "/notifications";
var params = {
path = "/notifications";
params = {
limit: ('limit' in opts) ? opts.limit : 30,
only: 'highlight',
};
@@ -1730,8 +1733,7 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
params.token = token;
}
var self = this;
var promise =
promise =
this._http.authedRequestWithPrefix(undefined, "GET", path, params,
undefined, httpApi.PREFIX_UNSTABLE
).then(function(res) {
@@ -1769,10 +1771,10 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
throw new Error("Unknown room " + eventTimeline.getRoomId());
}
var path = utils.encodeUri(
path = utils.encodeUri(
"/rooms/$roomId/messages", {$roomId: eventTimeline.getRoomId()}
);
var params = {
params = {
from: token,
limit: ('limit' in opts) ? opts.limit : 30,
dir: dir
@@ -1785,9 +1787,7 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
params.filter = JSON.stringify(filter.getRoomTimelineFilterComponent());
}
var self = this;
var promise =
promise =
this._http.authedRequest(undefined, "GET", path, params
).then(function(res) {
var token = res.end;