Introduce enableRingingForGroupCalls and add a labs setting for it

This commit is contained in:
ismailgulek
2021-04-09 14:54:03 +03:00
parent d696bcb904
commit db95c1cb4e
8 changed files with 57 additions and 3 deletions

View File

@@ -140,6 +140,11 @@ enum
OTHER_REPORT_BUG_INDEX,
};
enum
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0
};
enum
{
SECURITY_BUTTON_INDEX = 0,
@@ -475,6 +480,7 @@ TableViewSectionsDelegate>
if (BuildSettings.settingsScreenShowLabSettings)
{
Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS];
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
sectionLabs.headerTitle = NSLocalizedStringFromTable(@"settings_labs", @"Vector", nil);
if (sectionLabs.hasAnyRows)
{
@@ -2241,7 +2247,18 @@ TableViewSectionsDelegate>
}
else if (section == SECTION_TAG_LABS)
{
if (row == LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_enable_ringing_for_group_calls", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableRingingForGroupCalls;
labelAndSwitchCell.mxkSwitch.tintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRingingForGroupCalls:) forControlEvents:UIControlEventValueChanged];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_FLAIR)
{
@@ -2930,6 +2947,16 @@ TableViewSectionsDelegate>
}
}
- (void)toggleEnableRingingForGroupCalls:(UISwitch *)sender
{
if (sender)
{
RiotSettings.shared.enableRingingForGroupCalls = sender.isOn;
[self.tableView reloadData];
}
}
- (void)togglePinRoomsWithMissedNotif:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;