From b81ce6a9a104f36143f53f1d7629d327f3867bdc Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 16 Nov 2017 14:46:47 +0100 Subject: [PATCH] Crypto: Key sharing: Move the check of incoming key requests so that we can detect them at app startup. https://github.com/vector-im/riot-meta/issues/121 This is now required because, with https://github.com/matrix-org/matrix-ios-sdk/pull/414, key requests can be available when app starts. --- Riot/AppDelegate.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 7f38a44658..09485157bf 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -580,9 +580,6 @@ - (void)applicationDidBecomeActive:(UIApplication *)application } [self handleLaunchAnimation]; - - // Check if we need to display a key share dialog - [self checkPendingRoomKeyRequests]; } - (void)applicationWillTerminate:(UIApplication *)application @@ -1934,6 +1931,14 @@ - (void)initMatrixSessions } } } + else if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) + { + if (mxSession.state == MXSessionStateRunning) + { + // Check if we need to display a key share dialog + [self checkPendingRoomKeyRequests]; + } + } [self handleLaunchAnimation]; }];