Warn unknown devices: Add a send anyway button.

Add weakSelf sanity check.
This commit is contained in:
manuroe 2017-03-07 17:21:29 +01:00
parent 011622e93b
commit 1613b1b921

View file

@ -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";