diff --git a/Riot/Analytics/DecryptionFailureTracker.h b/Riot/Analytics/DecryptionFailureTracker.h index 7ddc2482f..92c7587f1 100644 --- a/Riot/Analytics/DecryptionFailureTracker.h +++ b/Riot/Analytics/DecryptionFailureTracker.h @@ -46,6 +46,11 @@ */ - (void)reportUnableToDecryptErrorForEvent:(MXEvent*)event withRoomState:(MXRoomState*)roomState myUser:(NSString*)userId; +/** + Flush current data. + */ +- (void)dispatch; + @end /** diff --git a/Riot/Analytics/DecryptionFailureTracker.m b/Riot/Analytics/DecryptionFailureTracker.m index 424570186..240f0ecd2 100644 --- a/Riot/Analytics/DecryptionFailureTracker.m +++ b/Riot/Analytics/DecryptionFailureTracker.m @@ -99,6 +99,11 @@ reportedFailures[event.eventId] = decryptionFailure; } +- (void)dispatch +{ + [self checkFailures]; +} + #pragma mark - Private methods /** diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 4d38c59c0..78db8a2c7 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -559,6 +559,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN _isAppForeground = NO; // Analytics: Force to send the pending actions + [[DecryptionFailureTracker sharedInstance] dispatch]; [[Analytics sharedInstance] dispatch]; }