Threads: added support to notifications count (MSC3773)

This commit is contained in:
Gil Eluard
2022-11-01 22:57:39 +01:00
parent 3b8090747c
commit 3c0562c24e
4 changed files with 10 additions and 13 deletions
+6 -10
View File
@@ -5918,17 +5918,13 @@ static CGSize kThreadListBarButtonItemImageSize;
{
if (self.roomDataSource.room)
{
// Retrieve the unread messages count
NSUInteger unreadCount = self.roomDataSource.room.summary.localUnreadEventCount;
// Retrieve the unread messages count on the current thread
NSUInteger unreadCount = [self.mainSession.store
localUnreadEventCount:self.roomDataSource.room.roomId
threadId:self.roomDataSource.threadId ?: kMXEventTimelineMain
withTypeIn:self.mainSession.unreadEventTypes];
if (!self.roomDataSource.threadId)
{
self.scrollToBottomBadgeLabel.text = unreadCount ? [NSString stringWithFormat:@"%lu", unreadCount] : nil;
}
else
{
self.scrollToBottomBadgeLabel.text = nil;
}
self.scrollToBottomBadgeLabel.text = unreadCount ? [NSString stringWithFormat:@"%lu", unreadCount] : nil;
self.scrollToBottomHidden = NO;
}
else