diff --git a/Vector/Model/RoomList/RecentsDataSource.m b/Vector/Model/RoomList/RecentsDataSource.m index e40ad6f4b..d85f947dc 100644 --- a/Vector/Model/RoomList/RecentsDataSource.m +++ b/Vector/Model/RoomList/RecentsDataSource.m @@ -22,6 +22,8 @@ #import "InviteRecentTableViewCell.h" +#import "MXRoom+Vector.h" + @interface RecentsDataSource() { NSMutableArray* invitesCellDataArray; @@ -111,6 +113,28 @@ } } +- (BOOL)isRoomNotifiedAtIndexPath:(NSIndexPath *)indexPath +{ + MXRoom* room = [self getRoomAtIndexPath:indexPath]; + + if (room) + { + return !room.areRoomNotificationsMuted; + } + + return YES; +} + +- (void)muteRoomNotifications:(BOOL)mute atIndexPath:(NSIndexPath *)indexPath +{ + MXRoom* room = [self getRoomAtIndexPath:indexPath]; + + // sanity check + if (room) + { + [room toggleRoomNotifications:mute]; + } +} - (void)didMXSessionInviteRoomUpdate:(NSNotification *)notif { diff --git a/Vector/ViewController/RecentsViewController.m b/Vector/ViewController/RecentsViewController.m index f3c3c07db..bfd650c99 100644 --- a/Vector/ViewController/RecentsViewController.m +++ b/Vector/ViewController/RecentsViewController.m @@ -410,9 +410,6 @@ static NSMutableDictionary* backgroundByImageNameDict; [self.recentsTableView setEditing:NO]; } - - - #pragma mark - Override UISearchBarDelegate - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText