mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
completed
This commit is contained in:
@@ -656,11 +656,18 @@ enum {
|
||||
|
||||
- (void)removeDevice
|
||||
{
|
||||
NSURL *logoutURL = [self.mainSession.homeserverWellknown.authentication getLogoutDeviceURLFromID:device.deviceId];
|
||||
if (logoutURL)
|
||||
MXWellKnownAuthentication *authentication = self.mainSession.homeserverWellknown.authentication;
|
||||
if (authentication)
|
||||
{
|
||||
[UIApplication.sharedApplication openURL:logoutURL options:@{} completionHandler:nil];
|
||||
[self withdrawViewControllerAnimated:YES completion:nil];
|
||||
NSURL *logoutURL = [authentication getLogoutDeviceURLFromID:device.deviceId];
|
||||
if (logoutURL)
|
||||
{
|
||||
[self removeDeviceRedirectWithURL:logoutURL];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self showRemoveDeviceRedirectError];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -668,6 +675,31 @@ enum {
|
||||
}
|
||||
}
|
||||
|
||||
-(void) removeDeviceRedirectWithURL: (NSURL * _Nonnull) url
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirect] message: nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
UIAlertAction *action = [UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler: ^(UIAlertAction * action) {
|
||||
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:^(BOOL success) {
|
||||
if (success && weakSelf)
|
||||
{
|
||||
[weakSelf withdrawViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
}];
|
||||
}];
|
||||
[alert addAction: action];
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
-(void) showRemoveDeviceRedirectError
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirectError] message: nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
-(void) removeDeviceThroughAPI
|
||||
{
|
||||
[self startActivityIndicator];
|
||||
|
||||
Reference in New Issue
Block a user