From 35f058c46a96e93e735a4dbb744f8fd8ff718ecb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 11 Jul 2018 14:27:45 -0400 Subject: [PATCH] Rework unread indicators. --- SignalMessaging/utils/OWSUnreadIndicator.h | 8 ++++++++ SignalMessaging/utils/ThreadUtil.m | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/utils/OWSUnreadIndicator.h b/SignalMessaging/utils/OWSUnreadIndicator.h index 5ce002456..b2d5ba9c0 100644 --- a/SignalMessaging/utils/OWSUnreadIndicator.h +++ b/SignalMessaging/utils/OWSUnreadIndicator.h @@ -12,6 +12,14 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) NSUInteger missingUnseenSafetyNumberChangeCount; +// The timestamp of the oldest unseen message. +// +// Once we enter messages view, we mark all messages read, so we need +// a snapshot of what the first unread message was when we entered the +// view so that we can call ensureDynamicInteractionsForThread:... +// repeatedly. The unread indicator should continue to show up until +// it has been cleared, at which point hideUnreadMessagesIndicator is +// YES in ensureDynamicInteractionsForThread:... @property (nonatomic, readonly) uint64_t firstUnseenInteractionTimestamp; // The index of the unseen indicator, counting from the _end_ of the conversation diff --git a/SignalMessaging/utils/ThreadUtil.m b/SignalMessaging/utils/ThreadUtil.m index 3086cab47..619ecc5d0 100644 --- a/SignalMessaging/utils/ThreadUtil.m +++ b/SignalMessaging/utils/ThreadUtil.m @@ -614,7 +614,7 @@ NS_ASSUME_NONNULL_BEGIN missingUnseenSafetyNumberChangeCount:missingUnseenSafetyNumberChangeCount unreadIndicatorPosition:unreadIndicatorPosition firstUnseenInteractionTimestamp:firstUnseenInteractionTimestamp.unsignedLongLongValue]; - DDLogInfo(@"%@ Creating TSUnreadIndicator: %llu", self.logTag, dynamicInteractions.unreadIndicator.timestamp); + DDLogInfo(@"%@ Creating Unread Indicator: %llu", self.logTag, dynamicInteractions.unreadIndicator.timestamp); } + (nullable NSNumber *)focusMessagePositionForThread:(TSThread *)thread