mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
no message
This commit is contained in:
30
TelegramCore/SavedStickerItem.swift
Normal file
30
TelegramCore/SavedStickerItem.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
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: Decoder) {
|
||||
self.file = decoder.decodeObjectForKey("f") as! TelegramMediaFile
|
||||
self.stringRepresentations = decoder.decodeStringArrayForKey("sr")
|
||||
}
|
||||
|
||||
public func encode(_ encoder: Encoder) {
|
||||
encoder.encodeObject(self.file, forKey: "f")
|
||||
encoder.encodeStringArray(self.stringRepresentations, forKey: "sr")
|
||||
}
|
||||
|
||||
public static func ==(lhs: SavedStickerItem, rhs: SavedStickerItem) -> Bool {
|
||||
return lhs.file.isEqual(rhs.file) && lhs.stringRepresentations == rhs.stringRepresentations
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user