1
0
Fork 0

Paginate removing all reactions from Matrix-side

This commit is contained in:
Cadence Ember 2023-10-14 23:34:02 +13:00
parent c24752625d
commit 040e987d03
4 changed files with 56 additions and 46 deletions

View file

@ -112,12 +112,16 @@ function getJoinedMembers(roomID) {
/**
* @param {string} roomID
* @param {string} eventID
* @param {{from?: string, limit?: any}} pagination
* @param {string?} [relType]
* @returns {Promise<Ty.Pagination<Ty.Event.Outer<any>>>}
*/
function getRelations(roomID, eventID, relType) {
function getRelations(roomID, eventID, pagination, relType) {
let path = `/client/v1/rooms/${roomID}/relations/${eventID}`
if (relType) path += `/${relType}`
if (!pagination.from) delete pagination.from
if (!pagination.limit) pagination.limit = 50 // get a little more consistency between homeservers
path += `?${new URLSearchParams(pagination)}`
return mreq.mreq("GET", path)
}