mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various improvements
This commit is contained in:
@@ -208,6 +208,20 @@ public final class UnreadMessageCountsView: PostboxView {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
public func countOrUnread(for item: UnreadMessageCountsItem) -> (Int32, Bool)? {
|
||||
for entry in self.entries {
|
||||
switch entry {
|
||||
case .total, .totalInGroup:
|
||||
break
|
||||
case let .peer(peerId, state):
|
||||
if case .peer(peerId, _) = item {
|
||||
return (state?.count ?? 0, state?.markedUnread ?? false)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
final class MutableCombinedReadStateView: MutablePostboxView {
|
||||
|
||||
Reference in New Issue
Block a user