mute_room_notifications

The room notification "mute" button is displayed even if there is a "always notify" room rule.
This commit is contained in:
yannick
2015-12-04 11:04:18 +01:00
parent b6bc331b2b
commit 4d8b8d2856
+13 -15
View File
@@ -471,22 +471,20 @@ static NSMutableDictionary* backgroundByImageNameDict;
if (room)
{
if ([self.dataSource canSuspendRoomNotificationsAtIndexPath:indexPath])
{
// pushes settings
BOOL isMuted = ![self.dataSource isRoomNotifiedAtIndexPath:indexPath];
// pushes settings
BOOL isMuted = ![self.dataSource isRoomNotifiedAtIndexPath:indexPath];
NSString* pushMessage = !isMuted ? @"Mute" : @"Unmute";
UITableViewRowAction *muteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:pushMessage handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
NSString* pushMessage = !isMuted ? @"Mute" : @"Unmute";
UITableViewRowAction *muteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:pushMessage handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self muteRoomNotifications:!isMuted atIndexPath:indexPath];
}];
muteAction.backgroundColor = [self getBackgroundColor:nil];
[actions insertObject:muteAction atIndex:0];
}
[self muteRoomNotifications:!isMuted atIndexPath:indexPath];
}];
muteAction.backgroundColor = [self getBackgroundColor:nil];
[actions insertObject:muteAction atIndex:0];
// favorites management
NSDictionary* tagsDict = [[NSDictionary alloc] init];