Merge branch 'gil/4494_space_menu' into gil/4501_show_suggested_in_room_lists

# Conflicts:
#	Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m
This commit is contained in:
Gil Eluard
2021-08-03 22:07:45 +02:00
55 changed files with 593 additions and 646 deletions
@@ -72,18 +72,9 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
processingQueue = dispatch_queue_create("RecentsDataSource", DISPATCH_QUEUE_SERIAL);
_crossSigningBannerDisplay = CrossSigningBannerDisplayNone;
crossSigningBannerSection = -1;
_secureBackupBannerDisplay = SecureBackupBannerDisplayNone;
secureBackupBannerSection = -1;
directorySection = -1;
invitesSection = -1;
favoritesSection = -1;
peopleSection = -1;
conversationSection = -1;
lowPrioritySection = -1;
serverNoticeSection = -1;
suggestedRoomsSection = -1;
[self resetSectionIndexes];
_areSectionsShrinkable = NO;
shrinkedSectionsBitMask = 0;
@@ -105,6 +96,20 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
[self unregisterSpaceServiceDidBuildGraphNotification];
}
- (void)resetSectionIndexes
{
crossSigningBannerSection = -1;
secureBackupBannerSection = -1;
directorySection = -1;
invitesSection = -1;
favoritesSection = -1;
peopleSection = -1;
conversationSection = -1;
lowPrioritySection = -1;
serverNoticeSection = -1;
suggestedRoomsSection = -1;
}
#pragma mark - Properties
- (NSArray *)invitesCellDataArray
@@ -473,10 +478,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
// Check whether all data sources are ready before rendering recents
if (self.state == MXKDataSourceStateReady)
{
MXLogDebug(@"[Spaces] numberOfSectionsInTableView: suggestedRoomCellDataArray %ld", self->state.suggestedRoomCellDataArray.count);
crossSigningBannerSection = secureBackupBannerSection = directorySection = favoritesSection = peopleSection = conversationSection = lowPrioritySection = invitesSection = serverNoticeSection = -1;
[self resetSectionIndexes];
if (self.crossSigningBannerDisplay != CrossSigningBannerDisplayNone)
{
@@ -1204,10 +1206,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
#pragma mark - MXKDataSourceDelegate
- (void)refreshRoomsSection:(void (^)(void))onComplete;
- (void)refreshRoomsSection:(void (^)(void))onComplete
{
secureBackupBannerSection = directorySection = favoritesSection = peopleSection = conversationSection = lowPrioritySection = serverNoticeSection = suggestedRoomsSection = invitesSection = -1;
if (displayedRecentsDataSourceArray.count > 0)
{
// FIXME manage multi accounts