mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Merge commit 'aaadcc73674cc8886e363693a7d7c08ac9b4f516' into feature/4260_merge_foss_1_10_2
# Conflicts: # Config/AppVersion.xcconfig # Podfile # Podfile.lock # Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved # Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/AuthenticationCoordinator.swift # Riot/Modules/Authentication/Legacy/LegacyAuthenticationCoordinator.swift # Riot/Modules/ContextMenu/ActionProviders/RoomActionProvider.swift # Riot/Modules/Home/AllChats/AllChatsViewController.swift # Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/Settings/RoomSettingsViewController.m # fastlane/Fastfile
This commit is contained in:
@@ -540,7 +540,6 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
|
||||
{
|
||||
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_MUTE_NOTIFICATIONS];
|
||||
}
|
||||
[sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_LEAVE];
|
||||
[tmpSections addObject:sectionMain];
|
||||
|
||||
if (!BWIBuildSettings.shared.roomSettingsScreenRemoveLeave) {
|
||||
@@ -2392,22 +2391,6 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
|
||||
cell = favoriteCell;
|
||||
}
|
||||
}
|
||||
else if (row == ROOM_SETTINGS_MAIN_SECTION_ROW_LEAVE)
|
||||
{
|
||||
MXKTableViewCellWithButton *leaveCell = [tableView dequeueReusableCellWithIdentifier:[MXKTableViewCellWithButton defaultReuseIdentifier] forIndexPath:indexPath];
|
||||
|
||||
NSString* title = [VectorL10n leave];
|
||||
|
||||
[leaveCell.mxkButton setTitle:title forState:UIControlStateNormal];
|
||||
[leaveCell.mxkButton setTitle:title forState:UIControlStateHighlighted];
|
||||
[leaveCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor];
|
||||
leaveCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17];
|
||||
|
||||
[leaveCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
|
||||
[leaveCell.mxkButton addTarget:self action:@selector(onLeave:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
cell = leaveCell;
|
||||
}
|
||||
}
|
||||
else if (section == SECTION_TAG_ACCESS)
|
||||
{
|
||||
@@ -3266,76 +3249,6 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
|
||||
|
||||
#pragma mark - actions
|
||||
|
||||
- (void)onLeave:(id)sender
|
||||
{
|
||||
// Prompt user before leaving the room
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
|
||||
NSString *title, *message;
|
||||
if ([self.mainSession roomWithRoomId:self.roomId].isDirect)
|
||||
{
|
||||
title = [VectorL10n roomParticipantsLeavePromptTitleForDm];
|
||||
message = [VectorL10n roomParticipantsLeavePromptMsgForDm];
|
||||
}
|
||||
else
|
||||
{
|
||||
title = [VectorL10n roomParticipantsLeavePromptTitle];
|
||||
message = [VectorL10n roomParticipantsLeavePromptMsg];
|
||||
}
|
||||
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:title
|
||||
message:message
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
}
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
|
||||
[self startActivityIndicator];
|
||||
[self->mxRoom leave:^{
|
||||
|
||||
if (self.delegate) {
|
||||
[self.delegate roomSettingsViewControllerDidLeaveRoom:self];
|
||||
} else {
|
||||
[[LegacyAppDelegate theDelegate] restoreInitialDisplay:nil];
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
[self stopActivityIndicator];
|
||||
|
||||
MXLogDebug(@"[RoomSettingsViewController] Leave room failed");
|
||||
// Alert user
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomSettingsVCLeaveAlert"];
|
||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)onRoomAvatarTap:(UITapGestureRecognizer *)recognizer
|
||||
{
|
||||
if (!mxRoom.isDirect || BWIBuildSettings.shared.showUnrelatedRoomSettingsForDirectMessages) {
|
||||
|
||||
Reference in New Issue
Block a user