Skip to content

Commit a933fbf

Browse files
committed
sync verifications with contact syncing
// FREEBIE
1 parent 37b7bf1 commit a933fbf

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ target 'Signal' do
55
pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git'
66
pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git'
77
#pod 'AxolotlKit', path: '../SignalProtocolKit'
8-
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
9-
#pod 'SignalServiceKit', path: '../SignalServiceKit'
8+
#pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
9+
pod 'SignalServiceKit', path: '../SignalServiceKit'
1010
pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/retain-keyboard-view'
1111
#pod 'JSQMessagesViewController', path: '../JSQMessagesViewController'
1212
pod 'PureLayout'

Podfile.lock

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ DEPENDENCIES:
112112
- JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/retain-keyboard-view`)
113113
- PureLayout
114114
- Reachability
115-
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`)
115+
- SignalServiceKit (from `../SignalServiceKit`)
116116
- SocketRocket (from `https://github.com/facebook/SocketRocket.git`)
117117

118118
EXTERNAL SOURCES:
@@ -122,7 +122,7 @@ EXTERNAL SOURCES:
122122
:branch: mkirk/retain-keyboard-view
123123
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
124124
SignalServiceKit:
125-
:git: https://github.com/WhisperSystems/SignalServiceKit.git
125+
:path: "../SignalServiceKit"
126126
SocketRocket:
127127
:git: https://github.com/facebook/SocketRocket.git
128128

@@ -133,9 +133,6 @@ CHECKOUT OPTIONS:
133133
JSQMessagesViewController:
134134
:commit: 521686c112bbae7a762f85d52b1e41eeb1760772
135135
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
136-
SignalServiceKit:
137-
:commit: 8b04e2a880bf31533c17359657ad9ae8a4db0d3d
138-
:git: https://github.com/WhisperSystems/SignalServiceKit.git
139136
SocketRocket:
140137
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf
141138
:git: https://github.com/facebook/SocketRocket.git
@@ -161,6 +158,6 @@ SPEC CHECKSUMS:
161158
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
162159
YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266
163160

164-
PODFILE CHECKSUM: 01734aea935bf91b25ee9aed90e20403075e5d19
161+
PODFILE CHECKSUM: 2088b6153dfaf0ce79fdf9141c7885c1ab84dd2b
165162

166163
COCOAPODS: 1.2.1

Signal/src/AppDelegate.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
181181
}];
182182

183183
self.contactsSyncing = [[OWSContactsSyncing alloc] initWithContactsManager:[Environment getCurrent].contactsManager
184+
identityManager:[OWSIdentityManager sharedManager]
184185
messageSender:[Environment getCurrent].messageSender];
185186

186187
[[NSNotificationCenter defaultCenter] addObserver:self

Signal/src/util/OWSContactsSyncing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ NS_ASSUME_NONNULL_BEGIN
88

99
@class OWSContactsManager;
1010
@class OWSMessageSender;
11+
@class OWSIdentityManager;
1112

1213
@interface OWSContactsSyncing : NSObject
1314

1415
- (instancetype)initWithContactsManager:(OWSContactsManager *)contactsManager
16+
identityManager:(OWSIdentityManager *)identityManager
1517
messageSender:(OWSMessageSender *)messageSender;
1618

1719
@end

Signal/src/util/OWSContactsSyncing.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ @interface OWSContactsSyncing ()
2222
@property (nonatomic, readonly) dispatch_queue_t serialQueue;
2323

2424
@property (nonatomic, readonly) OWSContactsManager *contactsManager;
25+
@property (nonatomic, readonly) OWSIdentityManager *identityManager;
2526
@property (nonatomic, readonly) OWSMessageSender *messageSender;
27+
2628
@property (nonatomic) BOOL isRequestInFlight;
2729

2830
@end
2931

3032
@implementation OWSContactsSyncing
3133

3234
- (instancetype)initWithContactsManager:(OWSContactsManager *)contactsManager
35+
identityManager:(OWSIdentityManager *)identityManager
3336
messageSender:(OWSMessageSender *)messageSender
3437
{
3538
self = [super init];
@@ -40,8 +43,10 @@ - (instancetype)initWithContactsManager:(OWSContactsManager *)contactsManager
4043

4144
OWSAssert(contactsManager);
4245
OWSAssert(messageSender);
46+
OWSAssert(identityManager);
4347

4448
_contactsManager = contactsManager;
49+
_identityManager = identityManager;
4550
_messageSender = messageSender;
4651

4752
OWSSingletonAssert();
@@ -85,8 +90,8 @@ - (void)sendSyncContactsMessageIfNecessary
8590
return;
8691
}
8792

88-
OWSSyncContactsMessage *syncContactsMessage =
89-
[[OWSSyncContactsMessage alloc] initWithContactsManager:self.contactsManager];
93+
OWSSyncContactsMessage *syncContactsMessage = [[OWSSyncContactsMessage alloc] initWithContactsManager:self.contactsManager
94+
identityManager:self.identityManager];
9095

9196
NSData *messageData = [syncContactsMessage buildPlainTextAttachmentData];
9297

0 commit comments

Comments
 (0)