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,34 @@
import Foundation
#if os(macOS)
import PostboxMac
#else
import Postbox
#endif
public struct ContactsSettings: Equatable, PreferencesEntry {
public var synchronizeContacts: Bool
public static var defaultSettings: ContactsSettings {
return ContactsSettings(synchronizeContacts: true)
}
public init(synchronizeContacts: Bool) {
self.synchronizeContacts = synchronizeContacts
}
public init(decoder: PostboxDecoder) {
self.synchronizeContacts = decoder.decodeInt32ForKey("synchronizeContacts", orElse: 0) != 0
}
public func encode(_ encoder: PostboxEncoder) {
encoder.encodeInt32(self.synchronizeContacts ? 1 : 0, forKey: "synchronizeContacts")
}
public func isEqual(to: PreferencesEntry) -> Bool {
if let to = to as? ContactsSettings {
return self == to
} else {
return false
}
}
}