mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-26 21:20:43 +00:00

git-subtree-dir: submodules/TelegramCore git-subtree-mainline: 971273e8f8f49a47f14b251d2f35e3445a61fc3f git-subtree-split: 9561227540acef69894e6546395ab223a6233600
31 lines
1010 B
Swift
31 lines
1010 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
#else
|
|
import Postbox
|
|
#endif
|
|
|
|
public final class SavedStickerItem: OrderedItemListEntryContents, Equatable {
|
|
public let file: TelegramMediaFile
|
|
public let stringRepresentations: [String]
|
|
|
|
init(file: TelegramMediaFile, stringRepresentations: [String]) {
|
|
self.file = file
|
|
self.stringRepresentations = stringRepresentations
|
|
}
|
|
|
|
public init(decoder: PostboxDecoder) {
|
|
self.file = decoder.decodeObjectForKey("f") as! TelegramMediaFile
|
|
self.stringRepresentations = decoder.decodeStringArrayForKey("sr")
|
|
}
|
|
|
|
public func encode(_ encoder: PostboxEncoder) {
|
|
encoder.encodeObject(self.file, forKey: "f")
|
|
encoder.encodeStringArray(self.stringRepresentations, forKey: "sr")
|
|
}
|
|
|
|
public static func ==(lhs: SavedStickerItem, rhs: SavedStickerItem) -> Bool {
|
|
return lhs.file.isEqual(to: rhs.file) && lhs.stringRepresentations == rhs.stringRepresentations
|
|
}
|
|
}
|