You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
Update /publicRooms to use the new pagination API
This commit is contained in:
@@ -415,12 +415,35 @@ MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) {
|
|||||||
// =========================
|
// =========================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {string} options.server The remote server to query for the room list.
|
||||||
|
* Optional. If unspecified, get the local home
|
||||||
|
* server's public room list.
|
||||||
|
* @param {number} options.limit Maximum number of entries to return
|
||||||
|
* @param {string} options.since Token to paginate from
|
||||||
|
* @param {object} options.filter Filter parameters
|
||||||
|
* @param {string} options.filter.generic_search_term String to search for
|
||||||
* @param {module:client.callback} callback Optional.
|
* @param {module:client.callback} callback Optional.
|
||||||
* @return {module:client.Promise} Resolves: TODO
|
* @return {module:client.Promise} Resolves: TODO
|
||||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
*/
|
*/
|
||||||
MatrixBaseApis.prototype.publicRooms = function(callback) {
|
MatrixBaseApis.prototype.publicRooms = function(options, callback) {
|
||||||
return this._http.authedRequest(callback, "GET", "/publicRooms");
|
if (typeof(options) == 'function') {
|
||||||
|
callback = options;
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
if (options === undefined) {
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
var query_params = {};
|
||||||
|
if (options.server) {
|
||||||
|
query_params.server = options.server;
|
||||||
|
delete options.server;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._http.authedRequest(
|
||||||
|
callback, "POST", "/publicRooms", query_params, options
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user