mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Add setting to disable URL previews.
Using a temporary position in the settings screen whilst waiting for feedback.
This commit is contained in:
@@ -120,6 +120,7 @@ enum
|
||||
{
|
||||
USER_INTERFACE_LANGUAGE_INDEX = 0,
|
||||
USER_INTERFACE_THEME_INDEX,
|
||||
USER_INTERFACE_SHOW_URL_PREVIEWS_INDEX,
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -461,6 +462,7 @@ TableViewSectionsDelegate>
|
||||
Section *sectionUserInterface = [Section sectionWithTag:SECTION_TAG_USER_INTERFACE];
|
||||
[sectionUserInterface addRowWithTag:USER_INTERFACE_LANGUAGE_INDEX];
|
||||
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];
|
||||
[sectionUserInterface addRowWithTag:USER_INTERFACE_SHOW_URL_PREVIEWS_INDEX];
|
||||
sectionUserInterface.headerTitle = NSLocalizedStringFromTable(@"settings_user_interface", @"Vector", nil);
|
||||
[tmpSections addObject: sectionUserInterface];
|
||||
|
||||
@@ -2104,6 +2106,18 @@ TableViewSectionsDelegate>
|
||||
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
|
||||
}
|
||||
else if (row == USER_INTERFACE_SHOW_URL_PREVIEWS_INDEX)
|
||||
{
|
||||
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
|
||||
|
||||
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_show_url_previews", @"Vector", nil);
|
||||
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenShowsURLPreviews;
|
||||
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
|
||||
|
||||
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableURLPreviews:) forControlEvents:UIControlEventValueChanged];
|
||||
|
||||
cell = labelAndSwitchCell;
|
||||
}
|
||||
}
|
||||
else if (section == SECTION_TAG_IGNORED_USERS)
|
||||
{
|
||||
@@ -3038,6 +3052,11 @@ TableViewSectionsDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
- (void)toggleEnableURLPreviews:(UISwitch *)sender
|
||||
{
|
||||
RiotSettings.shared.roomScreenShowsURLPreviews = sender.on;
|
||||
}
|
||||
|
||||
- (void)toggleSendCrashReport:(id)sender
|
||||
{
|
||||
BOOL enable = RiotSettings.shared.enableCrashReport;
|
||||
|
||||
Reference in New Issue
Block a user