mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Warn unknown devices: Add a send anyway button.
Add weakSelf sanity check.
This commit is contained in:
parent
011622e93b
commit
1613b1b921
1 changed files with 19 additions and 13 deletions
|
@ -3140,26 +3140,32 @@
|
|||
style:MXKAlertStyleAlert];
|
||||
|
||||
[currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"unknown_devices_verify"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
|
||||
[self performSegueWithIdentifier:@"showUnknownDevices" sender:self];
|
||||
[self performSegueWithIdentifier:@"showUnknownDevices" sender:self];
|
||||
}
|
||||
}];
|
||||
|
||||
[currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"unknown_devices_send_anyway"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
self->currentAlert = nil;
|
||||
|
||||
// Acknowledge the existence of all devices
|
||||
[self startActivityIndicator];
|
||||
[self.mainSession.crypto setDevicesKnown:self->unknownDevices complete:^{
|
||||
// Acknowledge the existence of all devices
|
||||
[self startActivityIndicator];
|
||||
[self.mainSession.crypto setDevicesKnown:self->unknownDevices complete:^{
|
||||
|
||||
self->unknownDevices = nil;
|
||||
[self stopActivityIndicator];
|
||||
self->unknownDevices = nil;
|
||||
[self stopActivityIndicator];
|
||||
|
||||
// And resend pending messages
|
||||
[self resendAllUnsentMessages];
|
||||
}];
|
||||
// And resend pending messages
|
||||
[self resendAllUnsentMessages];
|
||||
}];
|
||||
}
|
||||
}];
|
||||
|
||||
currentAlert.mxkAccessibilityIdentifier = @"RoomVCUnknownDevicesAlert";
|
||||
|
|
Loading…
Reference in a new issue