Refactor SyncCore

This commit is contained in:
Peter
2019-10-21 16:58:00 +04:00
parent 75aa77faa8
commit 10692a323e
1162 changed files with 12205 additions and 10925 deletions

View 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]
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
}
}