Messages - Room notification modes.

The web client defines 4 levels of notifications: 'All messages (loud)', 'All messages', 'Mentions only' and 'Mute'.
The ios client support only 2 modes: Mute / Unmute.

We update the client to map these 2 modes with the 4 new ones until a new design is defined to handle the 4 levels on mobile client:
- When a room is in 'Mute' or 'Mentions only mode', it is displayed as mute. Else it is unmute.
- When the user unmute a room, the room switches in 'All message mode'.
- When the user mute a room, the room switches in 'Mentions only' mode.

On ios client, mute a room
This commit is contained in:
giomfo
2016-09-08 10:43:03 +02:00
parent cd809e8e8c
commit 0c17bf4068
4 changed files with 363 additions and 73 deletions
+23 -9
View File
@@ -407,7 +407,7 @@
NSString* title = @" ";
// Notification toggle
BOOL isMuted = room.isMute;
BOOL isMuted = room.isMute || room.isMentionsOnly;
UITableViewRowAction *muteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:title handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
@@ -593,14 +593,28 @@
{
[self startActivityIndicator];
[room setMute:mute completion:^{
[self stopActivityIndicator];
// Leave editing mode
[self setEditing:NO];
}];
if (mute)
{
[room mentionsOnly:^{
[self stopActivityIndicator];
// Leave editing mode
[self setEditing:NO];
}];
}
else
{
[room allMessages:^{
[self stopActivityIndicator];
// Leave editing mode
[self setEditing:NO];
}];
}
}
else
{