Merge branch 'mkirk/notification-race' into release/2.39.0

This commit is contained in:
Michael Kirk 2019-04-10 07:13:22 -06:00
commit c59613557e
2 changed files with 14 additions and 0 deletions

View file

@ -496,10 +496,12 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
}
}
@objc
public func cancelNotifications(threadId: String) {
self.adaptee.cancelNotifications(threadId: threadId)
}
@objc
public func clearAllNotifications() {
adaptee.clearAllNotifications()
}

View file

@ -325,6 +325,11 @@ typedef enum : NSUInteger {
return SSKEnvironment.shared.tsAccountManager;
}
- (OWSNotificationPresenter *)notificationPresenter
{
return AppEnvironment.shared.notificationPresenter;
}
#pragma mark -
- (void)addNotificationListeners
@ -1187,6 +1192,13 @@ typedef enum : NSUInteger {
{
[super viewDidAppear:animated];
// We don't present incoming message notifications for the presented
// conversation. But there's a narrow window *while* the conversationVC
// is being presented where a message notification for the not-quite-yet
// presented conversation can be shown. If that happens, dismiss it as soon
// as we enter the conversation.
[self.notificationPresenter cancelNotificationsWithThreadId:self.thread.uniqueId];
// recover status bar when returning from PhotoPicker, which is dark (uses light status bar)
[self setNeedsStatusBarAppearanceUpdate];