1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Add space summary suggested only param

This commit is contained in:
Michael Telatynski
2021-03-05 16:12:39 +00:00
parent ad521bf4c2
commit 2f71c93b53

View File

@@ -2378,18 +2378,27 @@ MatrixBaseApis.prototype.reportEvent = function(roomId, eventId, score, reason)
* Fetches or paginates a summary of a space as defined by MSC2946 * Fetches or paginates a summary of a space as defined by MSC2946
* @param {string} roomId The ID of the space-room to use as the root of the summary. * @param {string} roomId The ID of the space-room to use as the root of the summary.
* @param {number?} maxRoomsPerSpace The maximum number of rooms to return per subspace. * @param {number?} maxRoomsPerSpace The maximum number of rooms to return per subspace.
* @param {boolean?} suggestedOnly Whether to only return rooms with suggested=true.
* @param {boolean?} autoJoinOnly Whether to only return rooms with auto_join=true. * @param {boolean?} autoJoinOnly Whether to only return rooms with auto_join=true.
* @param {number?} limit The maximum number of rooms to return in total. * @param {number?} limit The maximum number of rooms to return in total.
* @param {string?} batch The opaque token to paginate a previous summary request. * @param {string?} batch The opaque token to paginate a previous summary request.
* @returns {Promise} the response, with next_batch, rooms, events fields. * @returns {Promise} the response, with next_batch, rooms, events fields.
*/ */
MatrixBaseApis.prototype.getSpaceSummary = function(roomId, maxRoomsPerSpace, autoJoinOnly, limit, batch) { MatrixBaseApis.prototype.getSpaceSummary = function(
roomId,
maxRoomsPerSpace,
suggestedOnly,
autoJoinOnly,
limit,
batch,
) {
const path = utils.encodeUri("/rooms/$roomId/spaces", { const path = utils.encodeUri("/rooms/$roomId/spaces", {
$roomId: roomId, $roomId: roomId,
}); });
return this._http.authedRequest(undefined, "POST", path, null, { return this._http.authedRequest(undefined, "POST", path, null, {
max_rooms_per_space: maxRoomsPerSpace, max_rooms_per_space: maxRoomsPerSpace,
suggested_only: suggestedOnly,
auto_join_only: autoJoinOnly, auto_join_only: autoJoinOnly,
limit, limit,
batch, batch,