mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
MESSENGER-2762 Initial Merge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -121,8 +122,23 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
return self.recentsListService.invitedRoomListData.rooms;
|
||||
}
|
||||
- (NSArray<id<MXRoomSummaryProtocol>> *)favoriteCellDataArray
|
||||
{
|
||||
return self.recentsListService.favoritedRoomListData.rooms;
|
||||
{
|
||||
NSMutableArray<id<MXRoomSummaryProtocol>> *filteredArray = [NSMutableArray arrayWithArray:self.recentsListService.favoritedRoomListData.rooms];
|
||||
|
||||
if( _recentsDataSourceMode == RecentsDataSourceModeFavourites) {
|
||||
PersonalNotesDefaultService *service = [[PersonalNotesDefaultService alloc] initWithMxSession:self.mxSession];
|
||||
PersonalNotesSettings *settings = [[PersonalNotesSettings alloc] init];
|
||||
|
||||
if ([service personalNotesRoomId] && settings.personalNotesVisible) {
|
||||
MXRoom* room = [self.mxSession roomWithRoomId:[service personalNotesRoomId]];
|
||||
if (room) {
|
||||
MXRoomSummary *summary = [self.mxSession roomSummaryWithRoomId:[service personalNotesRoomId]];
|
||||
[filteredArray insertObject:summary atIndex:0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return filteredArray;
|
||||
}
|
||||
- (NSArray<id<MXRoomSummaryProtocol>> *)peopleCellDataArray
|
||||
{
|
||||
@@ -130,7 +146,16 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
}
|
||||
- (NSArray<id<MXRoomSummaryProtocol>> *)conversationCellDataArray
|
||||
{
|
||||
return self.recentsListService.conversationRoomListData.rooms;
|
||||
NSMutableArray<id<MXRoomSummaryProtocol>> *filteredArray = [NSMutableArray arrayWithCapacity:self.recentsListService.conversationRoomListData.rooms.count];
|
||||
|
||||
for ( id<MXRoomSummaryProtocol> object in self.recentsListService.conversationRoomListData.rooms) {
|
||||
MXRoom* room = [self.mxSession roomWithRoomId:object.roomId];
|
||||
if (!room.isPersonalNotesRoom) {
|
||||
[filteredArray addObject:object];
|
||||
}
|
||||
}
|
||||
|
||||
return filteredArray;
|
||||
}
|
||||
- (NSArray<id<MXRoomSummaryProtocol>> *)lowPriorityCellDataArray
|
||||
{
|
||||
@@ -487,7 +512,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
invitesSection = sectionsCount++;
|
||||
}
|
||||
|
||||
if (self.favoriteCellDataArray.count > 0)
|
||||
if (self.favoriteCellDataArray.count > 0 || _recentsDataSourceMode == RecentsDataSourceModeFavourites)
|
||||
{
|
||||
favoritesSection = sectionsCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user