diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift index 26c0ce6330..641d17d562 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift @@ -1077,6 +1077,16 @@ public final class PeerExpiringStoryListContext { return self.items.contains(where: { $0.id > self.maxReadId }) } + public var unseenCount: Int { + var count: Int = 0 + for item in items { + if item.id > maxReadId { + count += 1 + } + } + return count + } + public var hasUnseenCloseFriends: Bool { return self.items.contains(where: { $0.id > self.maxReadId && $0.isCloseFriends }) }