mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-18 11:30:04 +00:00
33 lines
802 B
Swift
33 lines
802 B
Swift
import Foundation
|
|
|
|
public enum PinnedItemId: Hashable {
|
|
case peer(PeerId)
|
|
case group(PeerGroupId)
|
|
|
|
public static func ==(lhs: PinnedItemId, rhs: PinnedItemId) -> Bool {
|
|
switch lhs {
|
|
case let .peer(id):
|
|
if case .peer(id) = rhs {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
case let .group(id):
|
|
if case .group(id) = rhs {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
|
|
public var hashValue: Int {
|
|
switch self {
|
|
case let .peer(id):
|
|
return id.hashValue
|
|
case let .group(id):
|
|
return id.hashValue
|
|
}
|
|
}
|
|
}
|