Various improvements

This commit is contained in:
Isaac
2025-03-13 00:34:59 +01:00
parent 950c3d9f1e
commit bb015f2bfa
16 changed files with 671 additions and 210 deletions

View File

@@ -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 {