mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-02 14:16:59 +02:00
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:
@@ -1509,18 +1509,34 @@ NSString *const kRoomSettingsAdvancedCellViewIdentifier = @"kRoomSettingsAdvance
|
||||
|
||||
if ([updatedItemsDict objectForKey:kRoomSettingsMuteNotifKey])
|
||||
{
|
||||
[mxRoom setMute:roomNotifSwitch.on completion:^{
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
if (roomNotifSwitch.on)
|
||||
{
|
||||
[mxRoom mentionsOnly:^{
|
||||
|
||||
[strongSelf->updatedItemsDict removeObjectForKey:kRoomSettingsMuteNotifKey];
|
||||
[strongSelf onSave:nil];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
|
||||
[strongSelf->updatedItemsDict removeObjectForKey:kRoomSettingsMuteNotifKey];
|
||||
[strongSelf onSave:nil];
|
||||
}
|
||||
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[mxRoom allMessages:^{
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
|
||||
[strongSelf->updatedItemsDict removeObjectForKey:kRoomSettingsMuteNotifKey];
|
||||
[strongSelf onSave:nil];
|
||||
}
|
||||
|
||||
}];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1798,7 +1814,7 @@ NSString *const kRoomSettingsAdvancedCellViewIdentifier = @"kRoomSettingsAdvance
|
||||
}
|
||||
else
|
||||
{
|
||||
roomNotifSwitch.on = mxRoom.isMute;
|
||||
roomNotifSwitch.on = mxRoom.isMute || mxRoom.isMentionsOnly;
|
||||
}
|
||||
|
||||
cell = roomNotifCell;
|
||||
@@ -2769,7 +2785,7 @@ NSString *const kRoomSettingsAdvancedCellViewIdentifier = @"kRoomSettingsAdvance
|
||||
{
|
||||
if (theSwitch == roomNotifSwitch)
|
||||
{
|
||||
if (roomNotifSwitch.on == mxRoom.isMute)
|
||||
if (roomNotifSwitch.on == (mxRoom.isMute || mxRoom.isMentionsOnly))
|
||||
{
|
||||
[updatedItemsDict removeObjectForKey:kRoomSettingsMuteNotifKey];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user