From a933fbf21555924e41576e20f8b4eb409edd8396 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 21 Jun 2017 21:11:50 -0400 Subject: [PATCH] sync verifications with contact syncing // FREEBIE --- Podfile | 4 ++-- Podfile.lock | 9 +++------ Signal/src/AppDelegate.m | 1 + Signal/src/util/OWSContactsSyncing.h | 2 ++ Signal/src/util/OWSContactsSyncing.m | 9 +++++++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Podfile b/Podfile index dc97c0ad0..556a820d2 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ target 'Signal' do pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' #pod 'AxolotlKit', path: '../SignalProtocolKit' - pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' - #pod 'SignalServiceKit', path: '../SignalServiceKit' + #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' + pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/retain-keyboard-view' #pod 'JSQMessagesViewController', path: '../JSQMessagesViewController' pod 'PureLayout' diff --git a/Podfile.lock b/Podfile.lock index d1888e291..4ea66d9e0 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -112,7 +112,7 @@ DEPENDENCIES: - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/retain-keyboard-view`) - PureLayout - Reachability - - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`) + - SignalServiceKit (from `../SignalServiceKit`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`) EXTERNAL SOURCES: @@ -122,7 +122,7 @@ EXTERNAL SOURCES: :branch: mkirk/retain-keyboard-view :git: https://github.com/WhisperSystems/JSQMessagesViewController.git SignalServiceKit: - :git: https://github.com/WhisperSystems/SignalServiceKit.git + :path: "../SignalServiceKit" SocketRocket: :git: https://github.com/facebook/SocketRocket.git @@ -133,9 +133,6 @@ CHECKOUT OPTIONS: JSQMessagesViewController: :commit: 521686c112bbae7a762f85d52b1e41eeb1760772 :git: https://github.com/WhisperSystems/JSQMessagesViewController.git - SignalServiceKit: - :commit: 8b04e2a880bf31533c17359657ad9ae8a4db0d3d - :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf :git: https://github.com/facebook/SocketRocket.git @@ -161,6 +158,6 @@ SPEC CHECKSUMS: UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266 -PODFILE CHECKSUM: 01734aea935bf91b25ee9aed90e20403075e5d19 +PODFILE CHECKSUM: 2088b6153dfaf0ce79fdf9141c7885c1ab84dd2b COCOAPODS: 1.2.1 diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 38234644b..0c45b54df 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -181,6 +181,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; }]; self.contactsSyncing = [[OWSContactsSyncing alloc] initWithContactsManager:[Environment getCurrent].contactsManager + identityManager:[OWSIdentityManager sharedManager] messageSender:[Environment getCurrent].messageSender]; [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/Signal/src/util/OWSContactsSyncing.h b/Signal/src/util/OWSContactsSyncing.h index 62072d96a..5c6d00453 100644 --- a/Signal/src/util/OWSContactsSyncing.h +++ b/Signal/src/util/OWSContactsSyncing.h @@ -8,10 +8,12 @@ NS_ASSUME_NONNULL_BEGIN @class OWSContactsManager; @class OWSMessageSender; +@class OWSIdentityManager; @interface OWSContactsSyncing : NSObject - (instancetype)initWithContactsManager:(OWSContactsManager *)contactsManager + identityManager:(OWSIdentityManager *)identityManager messageSender:(OWSMessageSender *)messageSender; @end diff --git a/Signal/src/util/OWSContactsSyncing.m b/Signal/src/util/OWSContactsSyncing.m index 62a9bc373..64aaabf74 100644 --- a/Signal/src/util/OWSContactsSyncing.m +++ b/Signal/src/util/OWSContactsSyncing.m @@ -22,7 +22,9 @@ NSString *const kTSStorageManagerOWSContactsSyncingLastMessageKey = @property (nonatomic, readonly) dispatch_queue_t serialQueue; @property (nonatomic, readonly) OWSContactsManager *contactsManager; +@property (nonatomic, readonly) OWSIdentityManager *identityManager; @property (nonatomic, readonly) OWSMessageSender *messageSender; + @property (nonatomic) BOOL isRequestInFlight; @end @@ -30,6 +32,7 @@ NSString *const kTSStorageManagerOWSContactsSyncingLastMessageKey = @implementation OWSContactsSyncing - (instancetype)initWithContactsManager:(OWSContactsManager *)contactsManager + identityManager:(OWSIdentityManager *)identityManager messageSender:(OWSMessageSender *)messageSender { self = [super init]; @@ -40,8 +43,10 @@ NSString *const kTSStorageManagerOWSContactsSyncingLastMessageKey = OWSAssert(contactsManager); OWSAssert(messageSender); + OWSAssert(identityManager); _contactsManager = contactsManager; + _identityManager = identityManager; _messageSender = messageSender; OWSSingletonAssert(); @@ -85,8 +90,8 @@ NSString *const kTSStorageManagerOWSContactsSyncingLastMessageKey = return; } - OWSSyncContactsMessage *syncContactsMessage = - [[OWSSyncContactsMessage alloc] initWithContactsManager:self.contactsManager]; + OWSSyncContactsMessage *syncContactsMessage = [[OWSSyncContactsMessage alloc] initWithContactsManager:self.contactsManager + identityManager:self.identityManager]; NSData *messageData = [syncContactsMessage buildPlainTextAttachmentData];