From 352e0acded7c61970036c1f75b438256c8307877 Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Tue, 12 Oct 2021 20:47:32 +0200 Subject: [PATCH 1/2] Support pagination in the Space Summary API --- MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m | 2 +- changelog.d/4893.feature | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4893.feature diff --git a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m index 525d5261f..245143975 100644 --- a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m +++ b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m @@ -157,7 +157,7 @@ -(void)updateSuggestedRooms { NSString *currentSpaceId = self.currentSpace.spaceId; MXWeakify(self); - [self.mxSession.spaceService getSpaceChildrenForSpaceWithId:currentSpaceId suggestedOnly:YES limit:5 success:^(MXSpaceChildrenSummary * _Nonnull childrenSummary) { + [self.mxSession.spaceService getSpaceChildrenForSpaceWithId:currentSpaceId suggestedOnly:YES limit:5 maxDepth:1 from:nil success:^(MXSpaceChildrenSummary * _Nonnull childrenSummary) { MXLogDebug(@"[MXKSessionRecentsDataSource] getSpaceChildrenForSpaceWithId %@: %ld found", self.currentSpace.spaceId, childrenSummary.childInfos.count); MXStrongifyAndReturnIfNil(self); self->lastSuggestedRooms[currentSpaceId] = childrenSummary.childInfos; diff --git a/changelog.d/4893.feature b/changelog.d/4893.feature new file mode 100644 index 000000000..6f4692d78 --- /dev/null +++ b/changelog.d/4893.feature @@ -0,0 +1 @@ +Moved from /space to /hierarchy API to support pagination \ No newline at end of file From 51208e7d2130addb1c7c3137fd224c88a9dddc84 Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Wed, 27 Oct 2021 10:27:04 +0200 Subject: [PATCH 2/2] Support pagination in the Space Summary API - Update after review --- MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m index 245143975..d4ff574a4 100644 --- a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m +++ b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m @@ -157,7 +157,7 @@ -(void)updateSuggestedRooms { NSString *currentSpaceId = self.currentSpace.spaceId; MXWeakify(self); - [self.mxSession.spaceService getSpaceChildrenForSpaceWithId:currentSpaceId suggestedOnly:YES limit:5 maxDepth:1 from:nil success:^(MXSpaceChildrenSummary * _Nonnull childrenSummary) { + [self.mxSession.spaceService getSpaceChildrenForSpaceWithId:currentSpaceId suggestedOnly:YES limit:5 maxDepth:1 paginationToken:nil success:^(MXSpaceChildrenSummary * _Nonnull childrenSummary) { MXLogDebug(@"[MXKSessionRecentsDataSource] getSpaceChildrenForSpaceWithId %@: %ld found", self.currentSpace.spaceId, childrenSummary.childInfos.count); MXStrongifyAndReturnIfNil(self); self->lastSuggestedRooms[currentSpaceId] = childrenSummary.childInfos;