Handle notifications for open conversations.

pull/2/head
Matthew Chen 5 years ago
parent f3d0cd99fc
commit 01d9993b9d

@ -648,7 +648,7 @@ class NotificationActionHandler {
// can be visible to the user immediately upon opening the app, rather than having to watch
// it animate in from the homescreen.
let shouldAnimate = UIApplication.shared.applicationState == .active
signalApp.presentConversation(forThreadId: threadId, animated: shouldAnimate)
signalApp.presentConversationAndShowFirstUnreadMessage(forThreadId: threadId, animated: shouldAnimate)
return Promise.value(())
}

@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
focusMessageId:(nullable NSString *)focusMessageId
animated:(BOOL)isAnimated;
- (void)presentConversationForThreadAndShowFirstUnreadMessage:(TSThread *)thread animated:(BOOL)isAnimated;
- (void)presentConversationAndShowFirstUnreadMessageForThreadId:(NSString *)threadId animated:(BOOL)isAnimated;
#pragma mark - Methods

@ -122,14 +122,16 @@ NS_ASSUME_NONNULL_BEGIN
});
}
- (void)presentConversationForThreadAndShowFirstUnreadMessage:(TSThread *)thread animated:(BOOL)isAnimated
- (void)presentConversationAndShowFirstUnreadMessageForThreadId:(NSString *)threadId animated:(BOOL)isAnimated
{
OWSAssertIsOnMainThread();
OWSAssertDebug(threadId.length > 0);
OWSLogInfo(@"");
if (!thread) {
OWSFailDebug(@"Can't present nil thread.");
TSThread *thread = [TSThread fetchObjectWithUniqueID:threadId];
if (thread == nil) {
OWSFailDebug(@"unable to find thread with id: %@", threadId);
return;
}

Loading…
Cancel
Save