Disable CDS.

pull/1/head
Matthew Chen 7 years ago
parent cbdc46fdab
commit 2af0a897e1

@ -7,6 +7,8 @@ import Foundation
@objc(OWSLegacyContactDiscoveryOperation) @objc(OWSLegacyContactDiscoveryOperation)
class LegacyContactDiscoveryBatchOperation: OWSOperation { class LegacyContactDiscoveryBatchOperation: OWSOperation {
private let isCDSEnabled = false
@objc @objc
var registeredRecipientIds: Set<String> var registeredRecipientIds: Set<String>
@ -83,13 +85,15 @@ class LegacyContactDiscoveryBatchOperation: OWSOperation {
// Called at most one time. // Called at most one time.
override func didSucceed() { override func didSucceed() {
// Compare against new CDS service if isCDSEnabled {
let modernCDSOperation = CDSOperation(recipientIdsToLookup: self.recipientIdsToLookup) // Compare against new CDS service
let cdsFeedbackOperation = CDSFeedbackOperation(legacyRegisteredRecipientIds: self.registeredRecipientIds) let modernCDSOperation = CDSOperation(recipientIdsToLookup: self.recipientIdsToLookup)
cdsFeedbackOperation.addDependency(modernCDSOperation) let cdsFeedbackOperation = CDSFeedbackOperation(legacyRegisteredRecipientIds: self.registeredRecipientIds)
cdsFeedbackOperation.addDependency(modernCDSOperation)
let operations = modernCDSOperation.dependencies + [modernCDSOperation, cdsFeedbackOperation]
CDSOperation.operationQueue.addOperations(operations, waitUntilFinished: false) let operations = modernCDSOperation.dependencies + [modernCDSOperation, cdsFeedbackOperation]
CDSOperation.operationQueue.addOperations(operations, waitUntilFinished: false)
}
} }
// MARK: Private Helpers // MARK: Private Helpers
@ -362,7 +366,7 @@ class CDSBatchOperation: OWSOperation {
} }
class func boolArray(data: Data) -> [Bool]? { class func boolArray(data: Data) -> [Bool]? {
var bools: [Bool]? = nil var bools: [Bool]?
data.withUnsafeBytes { (bytes: UnsafePointer<Bool>) -> Void in data.withUnsafeBytes { (bytes: UnsafePointer<Bool>) -> Void in
let buffer = UnsafeBufferPointer(start: bytes, count: data.count) let buffer = UnsafeBufferPointer(start: bytes, count: data.count)
bools = Array(buffer) bools = Array(buffer)

Loading…
Cancel
Save