Add a setting to hide/display redaction placeholders

This commit is contained in:
aringenbach
2022-06-13 14:18:18 +02:00
committed by aringenbach
parent faf77f9ad7
commit 901246173c
3 changed files with 27 additions and 1 deletions
+22 -1
View File
@@ -130,7 +130,8 @@ typedef NS_ENUM(NSUInteger, USER_INTERFACE)
{
USER_INTERFACE_LANGUAGE_INDEX = 0,
USER_INTERFACE_THEME_INDEX,
USER_INTERFACE_TIMELINE_STYLE_INDEX
USER_INTERFACE_TIMELINE_STYLE_INDEX,
USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY
};
typedef NS_ENUM(NSUInteger, IDENTITY_SERVER)
@@ -518,6 +519,8 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
// [sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
}
[sectionUserInterface addRowWithTag:USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY];
[tmpSections addObject: sectionUserInterface];
@@ -2264,6 +2267,19 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsUiShowRedactionsInRoomHistory;
labelAndSwitchCell.mxkSwitch.on = [MXKAppSettings standardAppSettings].showRedactionsInRoomHistory;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleShowRedacted:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_IGNORED_USERS)
{
@@ -3974,6 +3990,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
self.deactivateAccountViewController = deactivateAccountViewController;
}
- (void)toggleShowRedacted:(UISwitch *)sender
{
[MXKAppSettings standardAppSettings].showRedactionsInRoomHistory = sender.isOn;
}
- (void)togglePresenceOfflineMode:(UISwitch *)sender
{
MXKAccount *account = MXKAccountManager.sharedManager.accounts.firstObject;