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,27 @@
import Postbox
public final class RemoteStorageConfiguration: PreferencesEntry {
public let webDocumentsHostDatacenterId: Int32
public init(webDocumentsHostDatacenterId: Int32) {
self.webDocumentsHostDatacenterId = webDocumentsHostDatacenterId
}
public init(decoder: PostboxDecoder) {
self.webDocumentsHostDatacenterId = decoder.decodeInt32ForKey("webDocumentsHostDatacenterId", orElse: 4)
}
public func encode(_ encoder: PostboxEncoder) {
encoder.encodeInt32(self.webDocumentsHostDatacenterId, forKey: "webDocumentsHostDatacenterId")
}
public func isEqual(to: PreferencesEntry) -> Bool {
guard let to = to as? RemoteStorageConfiguration else {
return false
}
if self.webDocumentsHostDatacenterId != to.webDocumentsHostDatacenterId {
return false
}
return true
}
}