Max out the unread count at 99.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-06-20 11:22:30 -04:00
parent dc69034b64
commit 5796bbd858
2 changed files with 4 additions and 1 deletions

View file

@ -3812,7 +3812,8 @@ typedef enum : NSUInteger {
- (void)updateBackButtonUnreadCount
{
AssertIsOnMainThread();
self.backButtonUnreadCount = [self.messagesManager unreadMessagesCountExcept:self.thread];
// Max out the unread count at 99.
self.backButtonUnreadCount = MIN((NSUInteger)99, [self.messagesManager unreadMessagesCountExcept:self.thread]);
}
- (void)setBackButtonUnreadCount:(NSUInteger)unreadCount

View file

@ -117,6 +117,8 @@ const NSUInteger kContactPictureViewDiameter = 52;
NSAttributedString *attributedDate = [self dateAttributedString:thread.lastMessageDate];
NSUInteger unreadCount = [[TSMessagesManager sharedManager] unreadMessagesInThread:thread];
// Max out the per-thread unread count at 99.
unreadCount = MIN((NSUInteger)99, unreadCount);
self.nameLabel.text = name;
self.snippetLabel.attributedText = snippetText;