mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
[Spaces] Show spaces in left panel #4509
- moved space filtering to MatrixKit
This commit is contained in:
parent
8d6bdb7e8c
commit
49e19c48f0
2 changed files with 1 additions and 19 deletions
|
@ -100,8 +100,6 @@ extern NSString *const kRecentsDataSourceTapOnDirectoryServerChange;
|
|||
*/
|
||||
@property (nonatomic) PublicRoomsDirectoryDataSource *publicRoomsDirectoryDataSource;
|
||||
|
||||
@property (nonatomic, strong) MXSpace *currentSpace;
|
||||
|
||||
/**
|
||||
Refresh the recents data source and notify its delegate.
|
||||
*/
|
||||
|
|
|
@ -166,16 +166,6 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
|||
return state.unsentMessagesGroupDiscussionsCount;
|
||||
}
|
||||
|
||||
- (void)setCurrentSpace:(MXSpace *)currentSpace
|
||||
{
|
||||
MXLogDebug(@"[Spaces] setCurrentSpace %@", currentSpace.spaceId);
|
||||
|
||||
_currentSpace = currentSpace;
|
||||
[self refreshRoomsSection:^{
|
||||
[self.delegate dataSource:self didCellChange:nil];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)setDelegate:(id<MXKDataSourceDelegate>)delegate andRecentsDataSourceMode:(RecentsDataSourceMode)recentsDataSourceMode
|
||||
|
@ -1165,17 +1155,11 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
|||
NSMutableArray<id<MXKRecentCellDataStoring>> *cells = [NSMutableArray new];
|
||||
NSInteger count = recentsDataSource.numberOfCells;
|
||||
|
||||
NSDate *startDate = [NSDate new];
|
||||
MXLogDebug(@"[Spaces] starting filtering rooms");
|
||||
for (NSUInteger index = 0; index < count; index++)
|
||||
{
|
||||
id<MXKRecentCellDataStoring> cell = [recentsDataSource cellDataAtIndex:index];
|
||||
if (self.currentSpace == nil || [self.mxSession.spaceService isRoomWithId:cell.roomSummary.roomId descendantOf:self.currentSpace.spaceId])
|
||||
{
|
||||
[cells addObject:cell];
|
||||
}
|
||||
[cells addObject:cell];
|
||||
}
|
||||
MXLogDebug(@"[Spaces] ended filtering rooms after %f", [[NSDate new] timeIntervalSinceDate:startDate]);
|
||||
|
||||
MXWeakify(self);
|
||||
[self computeStateAsyncWithCells:cells recentsDataSourceMode:self.recentsDataSourceMode matrixSession:recentsDataSource.mxSession onComplete:^(RecentsDataSourceState *newState) {
|
||||
|
|
Loading…
Reference in a new issue