Skip to content

Commit

Permalink
Merge pull request #1637 from matrix-org/t3chguy/spaces4.5
Browse files Browse the repository at this point in the history
Add space summary suggested only param
  • Loading branch information
t3chguy committed Mar 10, 2021
2 parents 6c5fc15 + 2f71c93 commit e6a21cc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/base-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2378,18 +2378,27 @@ MatrixBaseApis.prototype.reportEvent = function(roomId, eventId, score, reason)
* 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 {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 {number?} limit The maximum number of rooms to return in total.
* @param {string?} batch The opaque token to paginate a previous summary request.
* @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", {
$roomId: roomId,
});

return this._http.authedRequest(undefined, "POST", path, null, {
max_rooms_per_space: maxRoomsPerSpace,
suggested_only: suggestedOnly,
auto_join_only: autoJoinOnly,
limit,
batch,
Expand Down

0 comments on commit e6a21cc

Please sign in to comment.