Skip to content

Commit

Permalink
Missing Push Notifications (#1696): Show a notification even if the a…
Browse files Browse the repository at this point in the history
…pp fails to sync with its hs to get all data.

Fixed easy Giom's remarks
  • Loading branch information
manuroe committed Dec 29, 2017
1 parent 97cb429 commit 8676024
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Riot/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ The current call view controller (if any).
/**
Cache for payloads received with incoming push notifications.
The key is the event id. The value, the payload.
Note: for the moment, objects in this dictionary are never removed but
the impact on memory is low.
*/
NSMutableDictionary <NSString*, NSDictionary*> *incomingPushPayloads;

Expand Down Expand Up @@ -548,6 +546,7 @@ - (void)applicationWillEnterForeground:(UIApplication *)application
{
[array removeAllObjects];
}
[incomingPushPayloads removeAllObjects];

// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

Expand Down Expand Up @@ -1495,7 +1494,7 @@ - (void)handleLimitedLocalNotifications:(MXSession*)mxSession events:(NSArray<NS
NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: incomingPushEventIds: %@", self.incomingPushEventIds[@(mxSession.hash)]);
NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: events: %@", events);

if (events.count)
if (!events.count)
{
return;
}
Expand Down

0 comments on commit 8676024

Please sign in to comment.