mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
27 lines
964 B
Swift
27 lines
964 B
Swift
import Foundation
|
|
import Postbox
|
|
|
|
public final class SavedStickerItem: OrderedItemListEntryContents, Equatable {
|
|
public let file: TelegramMediaFile
|
|
public let stringRepresentations: [String]
|
|
|
|
public 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
|
|
}
|
|
}
|