Use only latest profiles in the timeline (labs)

This commit is contained in:
Arnaud Ringenbach
2022-03-02 11:12:44 +01:00
committed by aringenbach
parent d9a6c4d8f2
commit a6ed656107
8 changed files with 47 additions and 6 deletions
+20 -1
View File
@@ -159,7 +159,8 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX,
LABS_ENABLE_MESSAGE_BUBBLES_INDEX
LABS_ENABLE_MESSAGE_BUBBLES_INDEX,
LABS_USE_ONLY_LATEST_PROFILES_INDEX
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -572,6 +573,7 @@ TableViewSectionsDelegate>
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_MESSAGE_BUBBLES_INDEX];
[sectionLabs addRowWithTag:LABS_USE_ONLY_LATEST_PROFILES_INDEX];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -2462,6 +2464,18 @@ TableViewSectionsDelegate>
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == LABS_USE_ONLY_LATEST_PROFILES_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsLabsUseOnlyLatestProfiles;
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenUseOnlyLatestProfiles;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleUseOnlyLatestProfiles:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_FLAIR)
{
@@ -3244,6 +3258,11 @@ TableViewSectionsDelegate>
}
}
- (void)toggleUseOnlyLatestProfiles:(UISwitch *)sender
{
RiotSettings.shared.roomScreenUseOnlyLatestProfiles = sender.isOn;
}
- (void)markAllAsRead:(id)sender
{
// Feedback: disable button and run activity indicator