diff --git a/MatrixKit/Controllers/MXKRecentListViewController.m b/MatrixKit/Controllers/MXKRecentListViewController.m index c086358ef..2ba7ae6c2 100644 --- a/MatrixKit/Controllers/MXKRecentListViewController.m +++ b/MatrixKit/Controllers/MXKRecentListViewController.m @@ -440,11 +440,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath id recentCellData = (id)cellData; if (recentCellData.isSuggestedRoom) { - [_delegate recentListViewController:self didSelectSuggestedRoom:recentCellData.spaceChildInfo]; + [_delegate recentListViewController:self + didSelectSuggestedRoom:recentCellData.roomSummary.spaceChildInfo]; } else { - [_delegate recentListViewController:self didSelectRoom:recentCellData.roomSummary.roomId inMatrixSession:recentCellData.roomSummary.mxSession]; + [_delegate recentListViewController:self + didSelectRoom:recentCellData.roomIdentifier + inMatrixSession:recentCellData.mxSession]; } } } diff --git a/MatrixKit/Models/Account/MXKAccount.m b/MatrixKit/Models/Account/MXKAccount.m index 88404d8b4..c30867251 100644 --- a/MatrixKit/Models/Account/MXKAccount.m +++ b/MatrixKit/Models/Account/MXKAccount.m @@ -877,7 +877,7 @@ -(void)openSessionWithStore:(id)store */ - (void)closeSession:(BOOL)clearStore { - MXLogDebug(@"[MXKAccount] closeSession (%tu)", clearStore); + MXLogDebug(@"[MXKAccount] closeSession (%u)", clearStore); if (NSCurrentLocaleDidChangeNotificationObserver) { diff --git a/MatrixKit/Models/MXKAppSettings.h b/MatrixKit/Models/MXKAppSettings.h index 483f7c6d3..710e1d5db 100644 --- a/MatrixKit/Models/MXKAppSettings.h +++ b/MatrixKit/Models/MXKAppSettings.h @@ -261,16 +261,6 @@ typedef NS_ENUM(NSUInteger, MXKKeyPreSharingStrategy) */ @property (nonatomic, getter=isCallKitEnabled) BOOL enableCallKit; -#pragma mark - Spaces - -/** - Return YES if the user wants to display all rooms in home - - This boolean value is defined in shared settings object with the key: `showAllRoomsInHomeSpace`. - Return NO if no value is defined. - */ -@property (nonatomic) BOOL showAllRoomsInHomeSpace; - #pragma mark - Shared userDefaults /** diff --git a/MatrixKit/Models/MXKAppSettings.m b/MatrixKit/Models/MXKAppSettings.m index 1f3bc5a6f..7365fc8c2 100644 --- a/MatrixKit/Models/MXKAppSettings.m +++ b/MatrixKit/Models/MXKAppSettings.m @@ -48,7 +48,6 @@ @implementation MXKAppSettings @synthesize syncLocalContacts, syncLocalContactsPermissionRequested, syncLocalContactsPermissionOpenedSystemSettings, phonebookCountryCode; @synthesize presenceColorForOnlineUser, presenceColorForUnavailableUser, presenceColorForOfflineUser; @synthesize enableCallKit; -@synthesize showAllRoomsInHomeSpace; @synthesize sharedUserDefaults; + (MXKAppSettings *)standardAppSettings @@ -126,7 +125,6 @@ -(instancetype)init _allowPushKitPushers = NO; _notificationBodyLocalizationKey = @"MESSAGE"; enableCallKit = YES; - showAllRoomsInHomeSpace = NO; eventsFilterForMessages = @[ kMXEventTypeStringRoomCreate, @@ -227,7 +225,6 @@ - (void)reset [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"firstURLDetectionIgnoredHosts"]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"enableCallKit"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"showAllRoomsInHomeSpace"]; } else { @@ -252,7 +249,6 @@ - (void)reset httpsLinkScheme = @"https"; enableCallKit = YES; - showAllRoomsInHomeSpace = NO; } } @@ -865,30 +861,4 @@ - (void)setEnableCallKit:(BOOL)enable } } -#pragma mark - Spaces - -- (BOOL)showAllRoomsInHomeSpace -{ - if (self == [MXKAppSettings standardAppSettings]) - { - return [[NSUserDefaults standardUserDefaults] boolForKey:@"showAllRoomsInHomeSpace"]; - } - else - { - return showAllRoomsInHomeSpace; - } -} - -- (void)setShowAllRoomsInHomeSpace:(BOOL)enable -{ - if (self == [MXKAppSettings standardAppSettings]) - { - [[NSUserDefaults standardUserDefaults] setBool:enable forKey:@"showAllRoomsInHomeSpace"]; - } - else - { - showAllRoomsInHomeSpace = enable; - } -} - @end diff --git a/MatrixKit/Models/MXKDataSource.h b/MatrixKit/Models/MXKDataSource.h index c8868ed1b..a1332d6e2 100644 --- a/MatrixKit/Models/MXKDataSource.h +++ b/MatrixKit/Models/MXKDataSource.h @@ -64,7 +64,7 @@ typedef enum : NSUInteger { /** The matrix session. */ -@property (nonatomic, readonly) MXSession *mxSession; +@property (nonatomic, weak, readonly) MXSession *mxSession; /** The data source state diff --git a/MatrixKit/Models/RoomList/MXKInterleavedRecentsDataSource.m b/MatrixKit/Models/RoomList/MXKInterleavedRecentsDataSource.m index 9e251a40b..28bb4c6ae 100644 --- a/MatrixKit/Models/RoomList/MXKInterleavedRecentsDataSource.m +++ b/MatrixKit/Models/RoomList/MXKInterleavedRecentsDataSource.m @@ -221,9 +221,10 @@ - (CGFloat)cellHeightAtIndexPath:(NSIndexPath *)indexPath id recentCellData = interleavedCellDataArray[indexPath.row]; // Select the related recent data source - MXKSessionRecentsDataSource *recentsDataSource = recentCellData.recentsDataSource; - if (recentsDataSource) + MXKDataSource *dataSource = recentCellData.dataSource; + if ([dataSource isKindOfClass:[MXKSessionRecentsDataSource class]]) { + MXKSessionRecentsDataSource *recentsDataSource = (MXKSessionRecentsDataSource*)dataSource; // Count the index of this cell data in original data source array NSInteger rank = 0; for (NSInteger index = 0; index < indexPath.row; index++) @@ -257,7 +258,7 @@ - (NSIndexPath*)cellIndexPathWithRoomId:(NSString*)roomId andMatrixSession:(MXSe for (NSInteger index = 0; index < recentsDataSource.numberOfCells; index ++) { id recentCellData = [recentsDataSource cellDataAtIndex:index]; - if ([roomId isEqualToString:recentCellData.roomSummary.roomId]) + if ([roomId isEqualToString:recentCellData.roomIdentifier]) { // Got it indexPath = [NSIndexPath indexPathForRow:index inSection:0]; @@ -280,7 +281,7 @@ - (NSIndexPath*)cellIndexPathWithRoomId:(NSString*)roomId andMatrixSession:(MXSe for (NSInteger index = 0; index < interleavedCellDataArray.count; index ++) { id recentCellData = interleavedCellDataArray[index]; - if ([roomId isEqualToString:recentCellData.roomSummary.roomId]) + if ([roomId isEqualToString:recentCellData.roomIdentifier]) { // Got it indexPath = [NSIndexPath indexPathForRow:index inSection:0]; @@ -408,7 +409,7 @@ - (void)dataSource:(MXKDataSource*)dataSource didCellChange:(id)changes id currentCellData = interleavedCellDataArray[currentCellIndex]; // Remove existing cell data of the updated data source - if (currentCellData.recentsDataSource == dataSource) + if (currentCellData.dataSource == dataSource) { [interleavedCellDataArray removeObjectAtIndex:currentCellIndex]; } diff --git a/MatrixKit/Models/RoomList/MXKRecentCellData.m b/MatrixKit/Models/RoomList/MXKRecentCellData.m index d7fa7dd8f..c3cf42f6f 100644 --- a/MatrixKit/Models/RoomList/MXKRecentCellData.m +++ b/MatrixKit/Models/RoomList/MXKRecentCellData.m @@ -17,71 +17,88 @@ #import "MXKRecentCellData.h" -#import "MXKSessionRecentsDataSource.h" +#import "MXKDataSource.h" #import "MXEvent+MatrixKit.h" #import @implementation MXKRecentCellData -@synthesize roomSummary, spaceChildInfo, recentsDataSource, roomDisplayname, lastEventTextMessage, lastEventAttributedTextMessage, lastEventDate; +@synthesize roomSummary, dataSource, lastEventDate; -- (instancetype)initWithRoomSummary:(MXRoomSummary*)theRoomSummary andRecentListDataSource:(MXKSessionRecentsDataSource*)recentListDataSource +- (instancetype)initWithRoomSummary:(id)theRoomSummary + dataSource:(MXKDataSource*)theDataSource; { self = [self init]; if (self) { roomSummary = theRoomSummary; - recentsDataSource = recentListDataSource; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update) name:kMXRoomSummaryDidChangeNotification object:roomSummary]; - - [self update]; + dataSource = theDataSource; } return self; } -- (instancetype)initWithSpaceChildInfo:(MXSpaceChildInfo*)theSpaceChildInfo andRecentListDataSource:(MXKSessionRecentsDataSource*)recentListDataSource +- (void)dealloc { - self = [self init]; - if (self) - { - spaceChildInfo = theSpaceChildInfo; - recentsDataSource = recentListDataSource; + roomSummary = nil; +} - [self update]; - } - return self; +- (MXSession *)mxSession +{ + return dataSource.mxSession; } -- (void)update +- (NSString*)lastEventDate { - // Keep ref on displayed last event - roomDisplayname = spaceChildInfo ? spaceChildInfo.name : roomSummary.displayname; + return (NSString*)roomSummary.lastMessage.others[@"lastEventDate"]; +} - lastEventTextMessage = spaceChildInfo ? spaceChildInfo.topic : roomSummary.lastMessage.text; - lastEventAttributedTextMessage = spaceChildInfo ? nil : roomSummary.lastMessage.attributedText; +- (BOOL)hasUnread +{ + return (roomSummary.localUnreadEventCount != 0); } -- (void)dealloc +- (NSString *)roomIdentifier { - if (roomSummary) + if (self.isSuggestedRoom) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:kMXRoomSummaryDidChangeNotification object:roomSummary]; + return self.roomSummary.spaceChildInfo.childRoomId; } - roomSummary = nil; - spaceChildInfo = nil; + return roomSummary.roomId; +} - lastEventTextMessage = nil; - lastEventAttributedTextMessage = nil; +- (NSString *)roomDisplayname +{ + if (self.isSuggestedRoom) + { + return self.roomSummary.spaceChildInfo.displayName; + } + return roomSummary.displayname; } -- (NSString*)lastEventDate +- (NSString *)avatarUrl { - return (NSString*)roomSummary.lastMessage.others[@"lastEventDate"]; + if (self.isSuggestedRoom) + { + return self.roomSummary.spaceChildInfo.avatarUrl; + } + return roomSummary.avatar; } -- (BOOL)hasUnread +- (NSString *)lastEventTextMessage { - return (roomSummary.localUnreadEventCount != 0); + if (self.isSuggestedRoom) + { + return roomSummary.spaceChildInfo.topic; + } + return roomSummary.lastMessage.text; +} + +- (NSAttributedString *)lastEventAttributedTextMessage +{ + if (self.isSuggestedRoom) + { + return nil; + } + return roomSummary.lastMessage.attributedText; } - (NSUInteger)notificationCount @@ -99,11 +116,6 @@ - (NSString*)notificationCountStringValue return [NSString stringWithFormat:@"%tu", self.notificationCount]; } -- (void)markAllAsRead -{ - [roomSummary markAllAsRead]; -} - - (NSString*)description { return [NSString stringWithFormat:@"%@ %@: %@ - %@", super.description, self.roomSummary.roomId, self.roomDisplayname, self.lastEventTextMessage]; @@ -112,7 +124,7 @@ - (NSString*)description - (BOOL)isSuggestedRoom { // As off now, we only store MXSpaceChildInfo in case of suggested rooms - return self.spaceChildInfo != nil; + return self.roomSummary.spaceChildInfo != nil; } @end diff --git a/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h b/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h index 7143282a7..8cf046696 100644 --- a/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h +++ b/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h @@ -20,7 +20,7 @@ #import "MXKCellData.h" -@class MXKSessionRecentsDataSource; +@class MXKDataSource; @class MXSpaceChildInfo; /** @@ -34,18 +34,16 @@ /** The original data source of the recent displayed by the cell. */ -@property (nonatomic, readonly) MXKSessionRecentsDataSource *recentsDataSource; +@property (nonatomic, weak, readonly) MXKDataSource *dataSource; /** - The `MXRoomSummary` instance of the room for the recent displayed by the cell. + The `MXRoomSummaryProtocol` instance of the room for the recent displayed by the cell. */ -@property (nonatomic, readonly) MXRoomSummary *roomSummary; -/** - In case of suggested rooms we store the `MXSpaceChildInfo` instance of the room - */ -@property (nonatomic, readonly) MXSpaceChildInfo *spaceChildInfo; +@property (nonatomic, readonly) id roomSummary; +@property (nonatomic, readonly) NSString *roomIdentifier; @property (nonatomic, readonly) NSString *roomDisplayname; +@property (nonatomic, readonly) NSString *avatarUrl; @property (nonatomic, readonly) NSString *lastEventTextMessage; @property (nonatomic, readonly) NSString *lastEventDate; @@ -55,34 +53,18 @@ @property (nonatomic, readonly) NSString *notificationCountStringValue; @property (nonatomic, readonly) BOOL isSuggestedRoom; -#pragma mark - Public methods -/** - Create a new `MXKCellData` object for a new recent cell. - - @param roomSummary the `MXRoomSummary` object that has data about the room. - @param recentListDataSource the `MXKSessionRecentsDataSource` object that will use this instance. - @return the newly created instance. - */ -- (instancetype)initWithRoomSummary:(MXRoomSummary*)roomSummary andRecentListDataSource:(MXKSessionRecentsDataSource*)recentListDataSource; +@property (nonatomic, readonly) MXSession *mxSession; +#pragma mark - Public methods /** Create a new `MXKCellData` object for a new recent cell. - @param spaceChildInfo the `MXSpaceChildInfo` object that has data about the room. - @param recentListDataSource the `MXKSessionRecentsDataSource` object that will use this instance. + @param roomSummary the `id` object that has data about the room. + @param dataSource the `MXKDataSource` object that will use this instance. @return the newly created instance. */ -- (instancetype)initWithSpaceChildInfo:(MXSpaceChildInfo*)spaceChildInfo andRecentListDataSource:(MXKSessionRecentsDataSource*)recentListDataSource; - -/** - The `MXKSessionRecentsDataSource` object calls this method when it detects a change in the room. - */ -- (void)update; - -/** - Mark all messages as read - */ -- (void)markAllAsRead; +- (instancetype)initWithRoomSummary:(id)roomSummary + dataSource:(MXKDataSource*)dataSource; @optional /** diff --git a/MatrixKit/Models/RoomList/MXKRecentsDataSource.h b/MatrixKit/Models/RoomList/MXKRecentsDataSource.h index 150aac2a4..b9de69b4a 100644 --- a/MatrixKit/Models/RoomList/MXKRecentsDataSource.h +++ b/MatrixKit/Models/RoomList/MXKRecentsDataSource.h @@ -76,11 +76,6 @@ */ - (void)removeMatrixSession:(MXSession*)mxSession; -/** - Mark all messages as read in all the displayed recents. - */ -- (void)markAllAsRead; - /** Filter the current recents list according to the provided patterns. diff --git a/MatrixKit/Models/RoomList/MXKRecentsDataSource.m b/MatrixKit/Models/RoomList/MXKRecentsDataSource.m index ab4bb7488..0da982a1d 100644 --- a/MatrixKit/Models/RoomList/MXKRecentsDataSource.m +++ b/MatrixKit/Models/RoomList/MXKRecentsDataSource.m @@ -242,14 +242,6 @@ - (BOOL)hasUnread return NO; } -- (void)markAllAsRead -{ - for (MXKSessionRecentsDataSource *recentsDataSource in displayedRecentsDataSourceArray) - { - [recentsDataSource markAllAsRead]; - } -} - - (void)searchWithPatterns:(NSArray*)patternsList { _searchPatternsList = patternsList; @@ -362,7 +354,7 @@ - (NSIndexPath*)cellIndexPathWithRoomId:(NSString*)roomId andMatrixSession:(MXSe for (NSInteger index = 0; index < recentsDataSource.numberOfCells; index ++) { id recentCellData = [recentsDataSource cellDataAtIndex:index]; - if ([roomId isEqualToString:recentCellData.roomSummary.roomId]) + if ([roomId isEqualToString:recentCellData.roomIdentifier]) { // Got it indexPath = [NSIndexPath indexPathForRow:index inSection:section]; @@ -613,7 +605,7 @@ - (MXRoom*)getRoomAtIndexPath:(NSIndexPath *)indexPath if (recentCellData) { - return recentCellData.roomSummary.room; + return [self.mxSession roomWithRoomId:recentCellData.roomIdentifier]; } return nil; diff --git a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h index e4a8a4c03..e3b1eb9e6 100644 --- a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h +++ b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h @@ -18,6 +18,7 @@ #import #import +#import "MXKConstants.h" #import "MXKDataSource.h" #import "MXKRecentCellData.h" @@ -31,6 +32,7 @@ extern NSString *const kMXKRecentCellIdentifier; /** The recents data source based on a unique matrix session. */ +MXK_DEPRECATED_ATTRIBUTE_WITH_MSG("See MXSession.roomListDataManager") @interface MXKSessionRecentsDataSource : MXKDataSource { @protected @@ -61,11 +63,6 @@ extern NSString *const kMXKRecentCellIdentifier; #pragma mark - Life cycle -/** - Mark all messages as read for all the recent cells - */ -- (void)markAllAsRead; - /** Filter the current recents list according to the provided patterns. When patterns are not empty, the search result is stored in `filteredCellDataArray`, diff --git a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m index a19e590fe..494dad58c 100644 --- a/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m +++ b/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.m @@ -212,16 +212,6 @@ - (BOOL)hasUnread return NO; } -- (void)markAllAsRead -{ - // Clear unread count on all recent cells - for (NSUInteger i = 0; i < self.numberOfCells; i++) - { - id cellData = [self cellDataAtIndex:i]; - [cellData markAllAsRead]; - } -} - - (void)searchWithPatterns:(NSArray*)patternsList { if (patternsList.count) @@ -289,6 +279,10 @@ - (CGFloat)cellHeightAtIndex:(NSInteger)index } #pragma mark - Events processing + +/** + Filtering in this method won't have any effect anymore. This class is not maintained. + */ - (void)loadData { [[NSNotificationCenter defaultCenter] removeObserver:self name:kMXRoomSummaryDidChangeNotification object:nil]; @@ -314,43 +308,25 @@ - (void)loadData NSDate *startDate = [NSDate date]; - BOOL showAllRoomsInHomeSpace = [MXKAppSettings standardAppSettings].showAllRoomsInHomeSpace; - for (MXRoomSummary *roomSummary in self.mxSession.roomsSummaries) { // Filter out private rooms with conference users if (!roomSummary.isConferenceUserRoom // @TODO Abstract this condition with roomSummary.hiddenFromUser && !roomSummary.hiddenFromUser) { - id cellData = [[class alloc] initWithRoomSummary:roomSummary andRecentListDataSource:self]; + id cellData = [[class alloc] initWithRoomSummary:roomSummary dataSource:self]; if (cellData) { - if (self.currentSpace == nil) - { - // In case of home space we show a room if one of the following conditions is true: - // - Show All Rooms is enabled - // - the space service has not been initialised (prevents to have empty rooms list while the space service is loading) - // - It's a direct room - // - The room is a favourite - // - The room is orphaned - if (showAllRoomsInHomeSpace || !self.mxSession.spaceService.isInitialised || roomSummary.isDirect || roomSummary.room.accountData.tags[kMXRoomTagFavourite] || [self.mxSession.spaceService isOrphanedRoomWithId:roomSummary.roomId]) { - [internalCellDataArray addObject:cellData]; - } - } - else - { - if ([self.mxSession.spaceService isRoomWithId:roomSummary.roomId descendantOf:self.currentSpace.spaceId]) - { - [internalCellDataArray addObject:cellData]; - } - } + [internalCellDataArray addObject:cellData]; } } } for (MXSpaceChildInfo *childInfo in _suggestedRooms) { - id cellData = [[class alloc] initWithSpaceChildInfo:childInfo andRecentListDataSource:self]; + id summary = [[MXRoomSummary alloc] initWithSpaceChildInfo:childInfo]; + id cellData = [[class alloc] initWithRoomSummary:summary + dataSource:self]; if (cellData) { [internalCellDataArray addObject:cellData]; @@ -420,7 +396,7 @@ - (void)didRoomSummaryChanged2:(NSNotification *)notif { // Create a new instance to not modify the content of 'cellDataArray' (the copy is not a deep copy). Class class = [self cellDataClassForCellIdentifier:kMXKRecentCellIdentifier]; - id cellData = [[class alloc] initWithRoomSummary:roomSummary andRecentListDataSource:self]; + id cellData = [[class alloc] initWithRoomSummary:roomSummary dataSource:self]; if (cellData) { [internalCellDataArray replaceObjectAtIndex:index withObject:cellData]; @@ -462,7 +438,7 @@ - (void)didMXSessionHaveNewRoom:(NSNotification *)notif Class class = [self cellDataClassForCellIdentifier:kMXKRecentCellIdentifier]; MXRoomSummary *roomSummary = [mxSession roomSummaryWithRoomId:roomId]; - id cellData = [[class alloc] initWithRoomSummary:roomSummary andRecentListDataSource:self]; + id cellData = [[class alloc] initWithRoomSummary:roomSummary dataSource:self]; if (cellData) { [internalCellDataArray addObject:cellData]; diff --git a/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m b/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m index 1ec4daed7..f1dce0891 100644 --- a/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m +++ b/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m @@ -1922,7 +1922,7 @@ - (BOOL)session:(MXSession *)session updateRoomSummary:(MXRoomSummary *)summary } else if (event.eventType == MXEventTypeRoomJoinRules) { - summary.others[@"mxkEventFormatterisJoinRulePublic"] = @(roomState.isJoinRulePublic); + summary.joinRule = roomState.joinRule; } } diff --git a/MatrixKit/Utils/MXKConstants.h b/MatrixKit/Utils/MXKConstants.h index 7a5659b8c..b580d234e 100644 --- a/MatrixKit/Utils/MXKConstants.h +++ b/MatrixKit/Utils/MXKConstants.h @@ -17,6 +17,9 @@ #import +#define MXK_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#define MXK_DEPRECATED_ATTRIBUTE_WITH_MSG(msg) __attribute((deprecated((msg)))) + /** The Matrix iOS Kit version. */ diff --git a/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.m b/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.m index 1da9b9f65..a4b17d16e 100644 --- a/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.m +++ b/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.m @@ -49,7 +49,7 @@ - (void)render:(MXKCellData *)cellData // Highlight the room owner by using his tint color. if (roomCellData) { - MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:roomCellData.roomSummary.room.mxSession.myUser.userId]; + MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:roomCellData.mxSession.myUserId]; if (account) { _userFlag.backgroundColor = account.userTintColor; diff --git a/MatrixKit/Views/RoomList/MXKRecentTableViewCell.m b/MatrixKit/Views/RoomList/MXKRecentTableViewCell.m index b7fbc43f0..3fdce7f75 100644 --- a/MatrixKit/Views/RoomList/MXKRecentTableViewCell.m +++ b/MatrixKit/Views/RoomList/MXKRecentTableViewCell.m @@ -45,8 +45,7 @@ - (void)render:(MXKCellData *)cellData } // Set in bold public room name - if (roomCellData.roomSummary.others[@"mxkEventFormatterisJoinRulePublic"] - && [(NSNumber*)roomCellData.roomSummary.others[@"mxkEventFormatterisJoinRulePublic"] boolValue]) + if ([roomCellData.roomSummary.joinRule isEqualToString:kMXRoomJoinRulePublic]) { _roomTitle.font = [UIFont boldSystemFontOfSize:20]; } diff --git a/changelog.d/4384.api b/changelog.d/4384.api new file mode 100644 index 000000000..2df2622d8 --- /dev/null +++ b/changelog.d/4384.api @@ -0,0 +1 @@ +MXKRecentsDataSource & MXKSessionRecentsDataSource: Remove `markAllAsRead` methods. diff --git a/changelog.d/4384.change b/changelog.d/4384.change new file mode 100644 index 000000000..ff21fd267 --- /dev/null +++ b/changelog.d/4384.change @@ -0,0 +1 @@ +MXKRecentCellDataStoring: New initializer & `roomIdentifier` and `avatarUrl` properties.