Swiftgram/Postbox/GroupFeedReadState.swift
2017-12-21 16:44:47 +04:00

21 lines
531 B
Swift

import Foundation
public struct GroupFeedReadState: Equatable {
public let maxReadIndex: MessageIndex
public init(maxReadIndex: MessageIndex) {
self.maxReadIndex = maxReadIndex
}
public static func ==(lhs: GroupFeedReadState, rhs: GroupFeedReadState) -> Bool {
if lhs.maxReadIndex != rhs.maxReadIndex {
return false
}
return true
}
func isIncomingMessageIndexRead(_ index: MessageIndex) -> Bool {
return self.maxReadIndex >= index
}
}