Add labs setting for threads

This commit is contained in:
ismailgulek
2021-11-09 15:18:18 +03:00
parent 70aea8cf92
commit 49cadec685
3 changed files with 26 additions and 1 deletions
+21 -1
View File
@@ -155,7 +155,8 @@ enum
enum
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX
};
enum
@@ -556,6 +557,7 @@ TableViewSectionsDelegate>
{
Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS];
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -2360,6 +2362,18 @@ TableViewSectionsDelegate>
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRingingForGroupCalls:) forControlEvents:UIControlEventValueChanged];
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_THREADS_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableThreads];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableThreads;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableThreads:) forControlEvents:UIControlEventValueChanged];
cell = labelAndSwitchCell;
}
}
@@ -3093,6 +3107,12 @@ TableViewSectionsDelegate>
RiotSettings.shared.enableRingingForGroupCalls = sender.isOn;
}
- (void)toggleEnableThreads:(UISwitch *)sender
{
RiotSettings.shared.enableThreads = sender.isOn;
[[MXKRoomDataSourceManager sharedManagerForMatrixSession:self.mainSession] reset];
}
- (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender
{
RiotSettings.shared.pinRoomsWithMissedNotificationsOnHome = sender.isOn;