mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
24 lines
822 B
Swift
24 lines
822 B
Swift
import Postbox
|
|
import Display
|
|
|
|
enum ChatHistoryLocation: Equatable {
|
|
case Initial(count: Int)
|
|
case InitialSearch(messageId: MessageId, count: Int)
|
|
case Navigation(index: MessageIndex, anchorIndex: MessageIndex)
|
|
case Scroll(index: MessageIndex, anchorIndex: MessageIndex, sourceIndex: MessageIndex, scrollPosition: ListViewScrollPosition, animated: Bool)
|
|
}
|
|
|
|
func ==(lhs: ChatHistoryLocation, rhs: ChatHistoryLocation) -> Bool {
|
|
switch lhs {
|
|
case let .Navigation(lhsIndex, lhsAnchorIndex):
|
|
switch rhs {
|
|
case let .Navigation(rhsIndex, rhsAnchorIndex) where lhsIndex == rhsIndex && lhsAnchorIndex == rhsAnchorIndex:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
default:
|
|
return false
|
|
}
|
|
}
|