mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
28 lines
774 B
Swift
28 lines
774 B
Swift
import Foundation
|
|
import Postbox
|
|
import TelegramCore
|
|
|
|
final class ChatEditInterfaceMessageState: Equatable {
|
|
let hasOriginalMedia: Bool
|
|
let media: Media?
|
|
|
|
init(hasOriginalMedia: Bool, media: Media?) {
|
|
self.hasOriginalMedia = hasOriginalMedia
|
|
self.media = media
|
|
}
|
|
|
|
static func ==(lhs: ChatEditInterfaceMessageState, rhs: ChatEditInterfaceMessageState) -> Bool {
|
|
if lhs.hasOriginalMedia != rhs.hasOriginalMedia {
|
|
return false
|
|
}
|
|
if let lhsMedia = lhs.media, let rhsMedia = rhs.media {
|
|
if !lhsMedia.isEqual(rhsMedia) {
|
|
return false
|
|
}
|
|
} else if (lhs.media != nil) != (rhs.media != nil) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|