mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
Feature/4014 new layout notes room
This commit is contained in:
committed by
JanNiklas Grabowski
parent
e57b51ed09
commit
0d1b84b04e
@@ -173,7 +173,17 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
}
|
||||
- (NSArray<id<MXRoomSummaryProtocol>> *)allChatsRoomCellDataArray
|
||||
{
|
||||
return self.recentsListService.allChatsRoomListData.rooms;
|
||||
// bwi: for personal notes room
|
||||
NSMutableArray<id<MXRoomSummaryProtocol>> *filteredArray = [NSMutableArray arrayWithCapacity:self.recentsListService.allChatsRoomListData.rooms.count];
|
||||
|
||||
for ( id<MXRoomSummaryProtocol> object in self.recentsListService.allChatsRoomListData.rooms) {
|
||||
MXRoom* room = [self.mxSession roomWithRoomId:object.roomId];
|
||||
if (!room.isPersonalNotesRoom) {
|
||||
[filteredArray addObject:object];
|
||||
}
|
||||
}
|
||||
|
||||
return filteredArray;
|
||||
}
|
||||
|
||||
- (NSInteger)totalVisibleItemCount
|
||||
@@ -229,6 +239,10 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
[types addObject:@(RecentsDataSourceSectionTypeBreadcrumbs)];
|
||||
}
|
||||
}
|
||||
|
||||
if (self.recentsListService.shouldShowBWIPersonalNotes) {
|
||||
[types addObject:@(RecentsDataSourceSectionTypePersonalNotes)];
|
||||
}
|
||||
|
||||
if (self.favoriteCellDataArray.count > 0 || _recentsDataSourceMode == RecentsDataSourceModeFavourites)
|
||||
{
|
||||
@@ -673,6 +687,10 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
{
|
||||
count = self.allChatsRoomCellDataArray.count ?: 1;
|
||||
}
|
||||
else if (sectionType == RecentsDataSourceSectionTypePersonalNotes)
|
||||
{
|
||||
count = 1;
|
||||
}
|
||||
|
||||
// Adjust this count according to the potential dragged cell.
|
||||
if ([self isMovingCellSection:section])
|
||||
@@ -696,7 +714,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
sectionType == RecentsDataSourceSectionTypeBreadcrumbs ||
|
||||
(sectionType == RecentsDataSourceSectionTypeInvites && self.recentsDataSourceMode == RecentsDataSourceModeAllChats) ||
|
||||
(sectionType == RecentsDataSourceSectionTypeAllChats && !self.allChatsFilterOptions.optionsCount) ||
|
||||
(sectionType == RecentsDataSourceSectionTypeAllChats && self.currentSpace != nil && self.currentSpace.childRoomIds.count == 0))
|
||||
(sectionType == RecentsDataSourceSectionTypeAllChats && self.currentSpace != nil && self.currentSpace.childRoomIds.count == 0) ||
|
||||
sectionType == RecentsDataSourceSectionTypePersonalNotes )
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
@@ -1236,6 +1255,11 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
summary = self.allChatsRoomCellDataArray[cellDataIndex];
|
||||
}
|
||||
}
|
||||
else if (sectionType == RecentsDataSourceSectionTypePersonalNotes) {
|
||||
PersonalNotesDefaultService* service = [[PersonalNotesDefaultService alloc] initWithMxSession:self.mxSession];
|
||||
|
||||
summary = [self.mxSession roomWithRoomId:[service personalNotesRoomId]].summary;
|
||||
}
|
||||
|
||||
if (summary)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user