namespace ContactsManager -> OWSContactsManager
rename test class ContactManager->OWSContact_s_Manager update docs // FREEBIE
This commit is contained in:
parent
b3bb4c745e
commit
1e0f0157c1
|
@ -24,7 +24,7 @@
|
||||||
76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; };
|
76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; };
|
||||||
76EB057218170B33006006FC /* RecentCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040018170B33006006FC /* RecentCall.m */; };
|
76EB057218170B33006006FC /* RecentCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040018170B33006006FC /* RecentCall.m */; };
|
||||||
76EB057418170B33006006FC /* RecentCallManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040218170B33006006FC /* RecentCallManager.m */; };
|
76EB057418170B33006006FC /* RecentCallManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040218170B33006006FC /* RecentCallManager.m */; };
|
||||||
76EB057A18170B33006006FC /* ContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* ContactsManager.m */; };
|
76EB057A18170B33006006FC /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; };
|
||||||
76EB058218170B33006006FC /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; };
|
76EB058218170B33006006FC /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; };
|
||||||
76EB058418170B33006006FC /* LocalizableText.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041518170B33006006FC /* LocalizableText.m */; };
|
76EB058418170B33006006FC /* LocalizableText.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041518170B33006006FC /* LocalizableText.m */; };
|
||||||
76EB058618170B33006006FC /* PreferencesUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041718170B33006006FC /* PreferencesUtil.m */; };
|
76EB058618170B33006006FC /* PreferencesUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041718170B33006006FC /* PreferencesUtil.m */; };
|
||||||
|
@ -172,7 +172,7 @@
|
||||||
B660F6B81C29868000687D6E /* JitterQueueTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6711C29867F00687D6E /* JitterQueueTest.m */; };
|
B660F6B81C29868000687D6E /* JitterQueueTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6711C29867F00687D6E /* JitterQueueTest.m */; };
|
||||||
B660F6B91C29868000687D6E /* SpeexCodecTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6721C29867F00687D6E /* SpeexCodecTest.m */; };
|
B660F6B91C29868000687D6E /* SpeexCodecTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6721C29867F00687D6E /* SpeexCodecTest.m */; };
|
||||||
B660F6BA1C29868000687D6E /* RecentCallTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6741C29867F00687D6E /* RecentCallTest.m */; };
|
B660F6BA1C29868000687D6E /* RecentCallTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6741C29867F00687D6E /* RecentCallTest.m */; };
|
||||||
B660F6BB1C29868000687D6E /* ContactManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6761C29867F00687D6E /* ContactManagerTest.m */; };
|
B660F6BB1C29868000687D6E /* OWSContactsManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6761C29867F00687D6E /* OWSContactsManagerTest.m */; };
|
||||||
B660F6BC1C29868000687D6E /* DnsManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6791C29867F00687D6E /* DnsManagerTest.m */; };
|
B660F6BC1C29868000687D6E /* DnsManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6791C29867F00687D6E /* DnsManagerTest.m */; };
|
||||||
B660F6BD1C29868000687D6E /* HttpRequestResponseTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F67B1C29867F00687D6E /* HttpRequestResponseTest.m */; };
|
B660F6BD1C29868000687D6E /* HttpRequestResponseTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F67B1C29867F00687D6E /* HttpRequestResponseTest.m */; };
|
||||||
B660F6BE1C29868000687D6E /* IpAddressTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F67C1C29867F00687D6E /* IpAddressTest.m */; };
|
B660F6BE1C29868000687D6E /* IpAddressTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F67C1C29867F00687D6E /* IpAddressTest.m */; };
|
||||||
|
@ -232,7 +232,7 @@
|
||||||
B660F7141C29988E00687D6E /* RecentCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040018170B33006006FC /* RecentCall.m */; };
|
B660F7141C29988E00687D6E /* RecentCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040018170B33006006FC /* RecentCall.m */; };
|
||||||
B660F7151C29988E00687D6E /* RecentCallManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040218170B33006006FC /* RecentCallManager.m */; };
|
B660F7151C29988E00687D6E /* RecentCallManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040218170B33006006FC /* RecentCallManager.m */; };
|
||||||
B660F7161C29988E00687D6E /* GroupContactsResult.m in Sources */ = {isa = PBXBuildFile; fileRef = B671B2451A93B238002BBD9D /* GroupContactsResult.m */; };
|
B660F7161C29988E00687D6E /* GroupContactsResult.m in Sources */ = {isa = PBXBuildFile; fileRef = B671B2451A93B238002BBD9D /* GroupContactsResult.m */; };
|
||||||
B660F7171C29988E00687D6E /* ContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* ContactsManager.m */; };
|
B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; };
|
||||||
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; };
|
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; };
|
||||||
B660F7191C29988E00687D6E /* EvpMessageDigest.m in Sources */ = {isa = PBXBuildFile; fileRef = 701231B418ECAA4500D456C4 /* EvpMessageDigest.m */; };
|
B660F7191C29988E00687D6E /* EvpMessageDigest.m in Sources */ = {isa = PBXBuildFile; fileRef = 701231B418ECAA4500D456C4 /* EvpMessageDigest.m */; };
|
||||||
B660F71A1C29988E00687D6E /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; };
|
B660F71A1C29988E00687D6E /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; };
|
||||||
|
@ -515,8 +515,8 @@
|
||||||
76EB040018170B33006006FC /* RecentCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCall.m; sourceTree = "<group>"; };
|
76EB040018170B33006006FC /* RecentCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCall.m; sourceTree = "<group>"; };
|
||||||
76EB040118170B33006006FC /* RecentCallManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentCallManager.h; sourceTree = "<group>"; };
|
76EB040118170B33006006FC /* RecentCallManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentCallManager.h; sourceTree = "<group>"; };
|
||||||
76EB040218170B33006006FC /* RecentCallManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCallManager.m; sourceTree = "<group>"; };
|
76EB040218170B33006006FC /* RecentCallManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCallManager.m; sourceTree = "<group>"; };
|
||||||
76EB040818170B33006006FC /* ContactsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsManager.h; sourceTree = "<group>"; };
|
76EB040818170B33006006FC /* OWSContactsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSContactsManager.h; sourceTree = "<group>"; };
|
||||||
76EB040918170B33006006FC /* ContactsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactsManager.m; sourceTree = "<group>"; };
|
76EB040918170B33006006FC /* OWSContactsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsManager.m; sourceTree = "<group>"; };
|
||||||
76EB041218170B33006006FC /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = "<group>"; };
|
76EB041218170B33006006FC /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = "<group>"; };
|
||||||
76EB041318170B33006006FC /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = "<group>"; };
|
76EB041318170B33006006FC /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = "<group>"; };
|
||||||
76EB041418170B33006006FC /* LocalizableText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizableText.h; sourceTree = "<group>"; };
|
76EB041418170B33006006FC /* LocalizableText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizableText.h; sourceTree = "<group>"; };
|
||||||
|
@ -786,7 +786,7 @@
|
||||||
B660F6711C29867F00687D6E /* JitterQueueTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitterQueueTest.m; sourceTree = "<group>"; };
|
B660F6711C29867F00687D6E /* JitterQueueTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitterQueueTest.m; sourceTree = "<group>"; };
|
||||||
B660F6721C29867F00687D6E /* SpeexCodecTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeexCodecTest.m; sourceTree = "<group>"; };
|
B660F6721C29867F00687D6E /* SpeexCodecTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeexCodecTest.m; sourceTree = "<group>"; };
|
||||||
B660F6741C29867F00687D6E /* RecentCallTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCallTest.m; sourceTree = "<group>"; };
|
B660F6741C29867F00687D6E /* RecentCallTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentCallTest.m; sourceTree = "<group>"; };
|
||||||
B660F6761C29867F00687D6E /* ContactManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactManagerTest.m; sourceTree = "<group>"; };
|
B660F6761C29867F00687D6E /* OWSContactsManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsManagerTest.m; sourceTree = "<group>"; };
|
||||||
B660F6791C29867F00687D6E /* DnsManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DnsManagerTest.m; sourceTree = "<group>"; };
|
B660F6791C29867F00687D6E /* DnsManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DnsManagerTest.m; sourceTree = "<group>"; };
|
||||||
B660F67B1C29867F00687D6E /* HttpRequestResponseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestResponseTest.m; sourceTree = "<group>"; };
|
B660F67B1C29867F00687D6E /* HttpRequestResponseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestResponseTest.m; sourceTree = "<group>"; };
|
||||||
B660F67C1C29867F00687D6E /* IpAddressTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IpAddressTest.m; sourceTree = "<group>"; };
|
B660F67C1C29867F00687D6E /* IpAddressTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IpAddressTest.m; sourceTree = "<group>"; };
|
||||||
|
@ -1180,8 +1180,8 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
76EB04A818170B33006006FC /* number directory */,
|
76EB04A818170B33006006FC /* number directory */,
|
||||||
76EB040818170B33006006FC /* ContactsManager.h */,
|
76EB040818170B33006006FC /* OWSContactsManager.h */,
|
||||||
76EB040918170B33006006FC /* ContactsManager.m */,
|
76EB040918170B33006006FC /* OWSContactsManager.m */,
|
||||||
);
|
);
|
||||||
path = contact;
|
path = contact;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1781,7 +1781,7 @@
|
||||||
B660F6751C29867F00687D6E /* contact */ = {
|
B660F6751C29867F00687D6E /* contact */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
B660F6761C29867F00687D6E /* ContactManagerTest.m */,
|
B660F6761C29867F00687D6E /* OWSContactsManagerTest.m */,
|
||||||
);
|
);
|
||||||
path = contact;
|
path = contact;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -2587,7 +2587,7 @@
|
||||||
76EB061018170B33006006FC /* EventWindow.m in Sources */,
|
76EB061018170B33006006FC /* EventWindow.m in Sources */,
|
||||||
E197B62718BBF63B00F073E5 /* SoundBoard.m in Sources */,
|
E197B62718BBF63B00F073E5 /* SoundBoard.m in Sources */,
|
||||||
76EB058418170B33006006FC /* LocalizableText.m in Sources */,
|
76EB058418170B33006006FC /* LocalizableText.m in Sources */,
|
||||||
76EB057A18170B33006006FC /* ContactsManager.m in Sources */,
|
76EB057A18170B33006006FC /* OWSContactsManager.m in Sources */,
|
||||||
E197B61918BBEC1A00F073E5 /* RemoteIOBufferListWrapper.m in Sources */,
|
E197B61918BBEC1A00F073E5 /* RemoteIOBufferListWrapper.m in Sources */,
|
||||||
76EB05A618170B33006006FC /* RtpPacket.m in Sources */,
|
76EB05A618170B33006006FC /* RtpPacket.m in Sources */,
|
||||||
76EB064218170B33006006FC /* StringUtil.m in Sources */,
|
76EB064218170B33006006FC /* StringUtil.m in Sources */,
|
||||||
|
@ -2743,7 +2743,7 @@
|
||||||
B660F7141C29988E00687D6E /* RecentCall.m in Sources */,
|
B660F7141C29988E00687D6E /* RecentCall.m in Sources */,
|
||||||
B660F7151C29988E00687D6E /* RecentCallManager.m in Sources */,
|
B660F7151C29988E00687D6E /* RecentCallManager.m in Sources */,
|
||||||
B660F7161C29988E00687D6E /* GroupContactsResult.m in Sources */,
|
B660F7161C29988E00687D6E /* GroupContactsResult.m in Sources */,
|
||||||
B660F7171C29988E00687D6E /* ContactsManager.m in Sources */,
|
B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */,
|
||||||
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */,
|
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */,
|
||||||
B660F7191C29988E00687D6E /* EvpMessageDigest.m in Sources */,
|
B660F7191C29988E00687D6E /* EvpMessageDigest.m in Sources */,
|
||||||
B660F71A1C29988E00687D6E /* EvpSymetricUtil.m in Sources */,
|
B660F71A1C29988E00687D6E /* EvpSymetricUtil.m in Sources */,
|
||||||
|
@ -2893,7 +2893,7 @@
|
||||||
B660F6D51C29868000687D6E /* TestUtil.m in Sources */,
|
B660F6D51C29868000687D6E /* TestUtil.m in Sources */,
|
||||||
B660F6B81C29868000687D6E /* JitterQueueTest.m in Sources */,
|
B660F6B81C29868000687D6E /* JitterQueueTest.m in Sources */,
|
||||||
B660F6DF1C29868000687D6E /* QueueTest.m in Sources */,
|
B660F6DF1C29868000687D6E /* QueueTest.m in Sources */,
|
||||||
B660F6BB1C29868000687D6E /* ContactManagerTest.m in Sources */,
|
B660F6BB1C29868000687D6E /* OWSContactsManagerTest.m in Sources */,
|
||||||
B660F6CE1C29868000687D6E /* PhoneNumberTest.m in Sources */,
|
B660F6CE1C29868000687D6E /* PhoneNumberTest.m in Sources */,
|
||||||
B660F6C41C29868000687D6E /* HandshakePacketTest.m in Sources */,
|
B660F6C41C29868000687D6E /* HandshakePacketTest.m in Sources */,
|
||||||
B660F6CD1C29868000687D6E /* UdpSocketTest.m in Sources */,
|
B660F6CD1C29868000687D6E /* UdpSocketTest.m in Sources */,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#import "AppStoreRating.h"
|
#import "AppStoreRating.h"
|
||||||
#import "CategorizingLogger.h"
|
#import "CategorizingLogger.h"
|
||||||
#import "CodeVerificationViewController.h"
|
#import "CodeVerificationViewController.h"
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "DebugLogger.h"
|
#import "DebugLogger.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "NotificationsManager.h"
|
#import "NotificationsManager.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <SignalServiceKit/TSCall.h>
|
#import <SignalServiceKit/TSCall.h>
|
||||||
#import "Contact.h"
|
#import "Contact.h"
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "PhoneNumber.h"
|
#import "PhoneNumber.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,13 +7,7 @@
|
||||||
#import "ObservableValue.h"
|
#import "ObservableValue.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
Get latest Signal contacts, and be notified when they change.
|
||||||
* ContactsManager provides access to an updated list of contacts with optional categorizations -
|
|
||||||
* such as searching and favourite-attributed contacts (favourites are also managed through this class)
|
|
||||||
* Others can subscribe for contact and/or favourite updates
|
|
||||||
* Contacts can be grouped by first letter into an NSDictionary in order to display in individual sections-
|
|
||||||
* in the ContactBrowseViewController.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SIGNAL_LIST_UPDATED @"Signal_AB_UPDATED"
|
#define SIGNAL_LIST_UPDATED @"Signal_AB_UPDATED"
|
||||||
|
@ -21,7 +15,7 @@
|
||||||
typedef void (^ABAccessRequestCompletionBlock)(BOOL hasAccess);
|
typedef void (^ABAccessRequestCompletionBlock)(BOOL hasAccess);
|
||||||
typedef void (^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
typedef void (^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
||||||
|
|
||||||
@interface ContactsManager : NSObject <ContactsManagerProtocol>
|
@interface OWSContactsManager : NSObject <ContactsManagerProtocol>
|
||||||
|
|
||||||
@property CNContactStore *contactStore;
|
@property CNContactStore *contactStore;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "ContactsUpdater.h"
|
#import "ContactsUpdater.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "Util.h"
|
#import "Util.h"
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL *);
|
typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL *);
|
||||||
|
|
||||||
@interface ContactsManager ()
|
@interface OWSContactsManager ()
|
||||||
|
|
||||||
@property id addressBookReference;
|
@property id addressBookReference;
|
||||||
@property TOCFuture *futureAddressBook;
|
@property TOCFuture *futureAddressBook;
|
||||||
|
@ -17,7 +17,7 @@ typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL *);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ContactsManager
|
@implementation OWSContactsManager
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[_life cancel];
|
[_life cancel];
|
||||||
|
@ -65,7 +65,7 @@ typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL *);
|
||||||
|
|
||||||
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context);
|
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context);
|
||||||
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context) {
|
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context) {
|
||||||
ContactsManager *contactsManager = (__bridge ContactsManager *)context;
|
OWSContactsManager *contactsManager = (__bridge OWSContactsManager *)context;
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
[contactsManager pullLatestAddressBook];
|
[contactsManager pullLatestAddressBook];
|
||||||
[contactsManager intersectContacts];
|
[contactsManager intersectContacts];
|
||||||
|
@ -76,7 +76,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
|
|
||||||
- (void)setupAddressBook {
|
- (void)setupAddressBook {
|
||||||
dispatch_async(ADDRESSBOOK_QUEUE, ^{
|
dispatch_async(ADDRESSBOOK_QUEUE, ^{
|
||||||
[[ContactsManager asyncGetAddressBook] thenDo:^(id addressBook) {
|
[[OWSContactsManager asyncGetAddressBook] thenDo:^(id addressBook) {
|
||||||
self.addressBookReference = addressBook;
|
self.addressBookReference = addressBook;
|
||||||
ABAddressBookRef cfAddressBook = (__bridge ABAddressBookRef)addressBook;
|
ABAddressBookRef cfAddressBook = (__bridge ABAddressBookRef)addressBook;
|
||||||
ABAddressBookRegisterExternalChangeCallback(cfAddressBook, onAddressBookChanged, (__bridge void *)self);
|
ABAddressBookRegisterExternalChangeCallback(cfAddressBook, onAddressBookChanged, (__bridge void *)self);
|
||||||
|
@ -107,7 +107,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
checkOperationDescribe(nil == creationError, [((__bridge NSError *)creationError)localizedDescription]);
|
checkOperationDescribe(nil == creationError, [((__bridge NSError *)creationError)localizedDescription]);
|
||||||
ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) {
|
ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) {
|
||||||
if (!granted) {
|
if (!granted) {
|
||||||
[ContactsManager blockingContactDialog];
|
[OWSContactsManager blockingContactDialog];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
[self.observableContactsController updateValue:[self getContactsFromAddressBook:addressBookRef]];
|
[self.observableContactsController updateValue:[self getContactsFromAddressBook:addressBookRef]];
|
||||||
|
@ -115,7 +115,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
|
|
||||||
- (void)setupLatestContacts:(NSArray *)contacts {
|
- (void)setupLatestContacts:(NSArray *)contacts {
|
||||||
if (contacts) {
|
if (contacts) {
|
||||||
self.latestContactsById = [ContactsManager keyContactsById:contacts];
|
self.latestContactsById = [OWSContactsManager keyContactsById:contacts];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
|
|
||||||
- (NSArray *)latestContactsWithSearchString:(NSString *)searchString {
|
- (NSArray *)latestContactsWithSearchString:(NSString *)searchString {
|
||||||
return [self.latestContactsById.allValues filter:^int(Contact *contact) {
|
return [self.latestContactsById.allValues filter:^int(Contact *contact) {
|
||||||
return searchString.length == 0 || [ContactsManager name:contact.fullName matchesQuery:searchString];
|
return searchString.length == 0 || [OWSContactsManager name:contact.fullName matchesQuery:searchString];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ static NSString *const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
#define TESTING_OPTION_USE_DH_FOR_HANDSHAKE @"DhKeyAgreementOnly"
|
#define TESTING_OPTION_USE_DH_FOR_HANDSHAKE @"DhKeyAgreementOnly"
|
||||||
|
|
||||||
@class RecentCallManager;
|
@class RecentCallManager;
|
||||||
@class ContactsManager;
|
@class OWSContactsManager;
|
||||||
@class PhoneManager;
|
@class PhoneManager;
|
||||||
@class SignalsViewController;
|
@class SignalsViewController;
|
||||||
@class TSGroupThread;
|
@class TSGroupThread;
|
||||||
|
@ -44,7 +44,7 @@ static NSString *const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
@property (nonatomic, readonly) NSArray *testingAndLegacyOptions;
|
@property (nonatomic, readonly) NSArray *testingAndLegacyOptions;
|
||||||
@property (nonatomic, readonly) NSData *zrtpClientId;
|
@property (nonatomic, readonly) NSData *zrtpClientId;
|
||||||
@property (nonatomic, readonly) NSData *zrtpVersionId;
|
@property (nonatomic, readonly) NSData *zrtpVersionId;
|
||||||
@property (nonatomic, readonly) ContactsManager *contactsManager;
|
@property (nonatomic, readonly) OWSContactsManager *contactsManager;
|
||||||
|
|
||||||
@property (nonatomic, readonly) SignalsViewController *signalsViewController;
|
@property (nonatomic, readonly) SignalsViewController *signalsViewController;
|
||||||
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
|
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
|
||||||
|
@ -66,7 +66,7 @@ static NSString *const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
andTestingAndLegacyOptions:(NSArray *)testingAndLegacyOptions
|
andTestingAndLegacyOptions:(NSArray *)testingAndLegacyOptions
|
||||||
andZrtpClientId:(NSData *)zrtpClientId
|
andZrtpClientId:(NSData *)zrtpClientId
|
||||||
andZrtpVersionId:(NSData *)zrtpVersionId
|
andZrtpVersionId:(NSData *)zrtpVersionId
|
||||||
andContactsManager:(ContactsManager *)contactsManager;
|
andContactsManager:(OWSContactsManager *)contactsManager;
|
||||||
|
|
||||||
+ (Environment *)getCurrent;
|
+ (Environment *)getCurrent;
|
||||||
+ (void)setCurrent:(Environment *)curEnvironment;
|
+ (void)setCurrent:(Environment *)curEnvironment;
|
||||||
|
|
|
@ -67,7 +67,7 @@ static Environment *environment = nil;
|
||||||
andTestingAndLegacyOptions:(NSArray *)testingAndLegacyOptions
|
andTestingAndLegacyOptions:(NSArray *)testingAndLegacyOptions
|
||||||
andZrtpClientId:(NSData *)zrtpClientId
|
andZrtpClientId:(NSData *)zrtpClientId
|
||||||
andZrtpVersionId:(NSData *)zrtpVersionId
|
andZrtpVersionId:(NSData *)zrtpVersionId
|
||||||
andContactsManager:(ContactsManager *)contactsManager {
|
andContactsManager:(OWSContactsManager *)contactsManager {
|
||||||
ows_require(errorNoter != nil);
|
ows_require(errorNoter != nil);
|
||||||
ows_require(zrtpClientId != nil);
|
ows_require(zrtpClientId != nil);
|
||||||
ows_require(zrtpVersionId != nil);
|
ows_require(zrtpVersionId != nil);
|
||||||
|
|
|
@ -58,7 +58,7 @@ static unsigned char DH3K_PRIME[] = {
|
||||||
]
|
]
|
||||||
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
||||||
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
||||||
andContactsManager:[ContactsManager new]];
|
andContactsManager:[OWSContactsManager new]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (Environment *)stagingEnvironmentWithLogging:(id<Logging>)logging {
|
+ (Environment *)stagingEnvironmentWithLogging:(id<Logging>)logging {
|
||||||
|
@ -82,7 +82,7 @@ static unsigned char DH3K_PRIME[] = {
|
||||||
]
|
]
|
||||||
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
||||||
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
||||||
andContactsManager:[ContactsManager new]];
|
andContactsManager:[OWSContactsManager new]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (Environment *)unitTestEnvironment:(NSArray *)testingAndLegacyOptions {
|
+ (Environment *)unitTestEnvironment:(NSArray *)testingAndLegacyOptions {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#import <PushKit/PushKit.h>
|
#import <PushKit/PushKit.h>
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "InCallViewController.h"
|
#import "InCallViewController.h"
|
||||||
#import "NSData+ows_StripToken.h"
|
#import "NSData+ows_StripToken.h"
|
||||||
#import "NSDate+millisecondTimeStamp.h"
|
#import "NSDate+millisecondTimeStamp.h"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#import <SignalServiceKit/TSAccountManager.h>
|
#import <SignalServiceKit/TSAccountManager.h>
|
||||||
#import "Contact.h"
|
#import "Contact.h"
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "SignalKeyingStorage.h"
|
#import "SignalKeyingStorage.h"
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
- (instancetype)initWithMembersId:(NSArray *)memberIdentifiers without:(NSArray *)removeIds {
|
- (instancetype)initWithMembersId:(NSArray *)memberIdentifiers without:(NSArray *)removeIds {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
ContactsManager *manager = [Environment.getCurrent contactsManager];
|
OWSContactsManager *manager = [Environment.getCurrent contactsManager];
|
||||||
|
|
||||||
NSMutableSet *remainingNumbers = [NSMutableSet setWithArray:memberIdentifiers];
|
NSMutableSet *remainingNumbers = [NSMutableSet setWithArray:memberIdentifiers];
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#import "CodeVerificationViewController.h"
|
#import "CodeVerificationViewController.h"
|
||||||
|
|
||||||
#import <SignalServiceKit/TSStorageManager+keyingMaterial.h>
|
#import <SignalServiceKit/TSStorageManager+keyingMaterial.h>
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "LocalizableText.h"
|
#import "LocalizableText.h"
|
||||||
#import "PushManager.h"
|
#import "PushManager.h"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#import <MobileCoreServices/UTCoreTypes.h>
|
#import <MobileCoreServices/UTCoreTypes.h>
|
||||||
#import <SignalServiceKit/TSAccountManager.h>
|
#import <SignalServiceKit/TSAccountManager.h>
|
||||||
#import <YapDatabase/YapDatabaseView.h>
|
#import <YapDatabase/YapDatabaseView.h>
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "DJWActionSheet+OWS.h"
|
#import "DJWActionSheet+OWS.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "FingerprintViewController.h"
|
#import "FingerprintViewController.h"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#import <SignalServiceKit/TSAccountManager.h>
|
#import <SignalServiceKit/TSAccountManager.h>
|
||||||
#import <SignalServiceKit/TSMessagesManager+attachments.h>
|
#import <SignalServiceKit/TSMessagesManager+attachments.h>
|
||||||
#import <SignalServiceKit/TSMessagesManager+sendMessages.h>
|
#import <SignalServiceKit/TSMessagesManager+sendMessages.h>
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "DJWActionSheet+OWS.h"
|
#import "DJWActionSheet+OWS.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "FunctionalUtil.h"
|
#import "FunctionalUtil.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#import "TSSocketManager.h"
|
#import "TSSocketManager.h"
|
||||||
|
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
|
|
||||||
#import "AboutTableViewController.h"
|
#import "AboutTableViewController.h"
|
||||||
#import "AdvancedSettingsTableViewController.h"
|
#import "AdvancedSettingsTableViewController.h"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#import "SignalsViewController.h"
|
#import "SignalsViewController.h"
|
||||||
|
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "GroupContactsResult.h"
|
#import "GroupContactsResult.h"
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#import "InboxTableViewCell.h"
|
#import "InboxTableViewCell.h"
|
||||||
#import "UIUtil.h"
|
#import "UIUtil.h"
|
||||||
|
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
#import "InCallViewController.h"
|
#import "InCallViewController.h"
|
||||||
#import "MessagesViewController.h"
|
#import "MessagesViewController.h"
|
||||||
#import "NSDate+millisecondTimeStamp.h"
|
#import "NSDate+millisecondTimeStamp.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import "ContactsManager.h"
|
#import "OWSContactsManager.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
#import "TestUtil.h"
|
|
||||||
#import "ContactsManager.h"
|
|
||||||
|
|
||||||
@interface ContactManagerTest : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation ContactManagerTest
|
|
||||||
|
|
||||||
- (void)testQueryMatching {
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"big dave"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"dave big"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"dave"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"big"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"big "]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@" big "]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"dav"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"bi dav"]);
|
|
||||||
test([ContactsManager name:@"big dave" matchesQuery:@"big big big big big big big big big big dave dave dave dave dave"]);
|
|
||||||
|
|
||||||
test(![ContactsManager name:@"big dave" matchesQuery:@"ave"]);
|
|
||||||
test(![ContactsManager name:@"big dave" matchesQuery:@"dare"]);
|
|
||||||
test(![ContactsManager name:@"big dave" matchesQuery:@"mike"]);
|
|
||||||
test(![ContactsManager name:@"big dave" matchesQuery:@"mike"]);
|
|
||||||
test(![ContactsManager name:@"dave" matchesQuery:@"big"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
#import <XCTest/XCTest.h>
|
||||||
|
#import "TestUtil.h"
|
||||||
|
#import "OWSContactsManager.h"
|
||||||
|
|
||||||
|
@interface OWSContactsManagerTest : XCTestCase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation OWSContactsManagerTest
|
||||||
|
|
||||||
|
- (void)testQueryMatching {
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"big dave"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"dave big"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"dave"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"big"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"big "]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@" big "]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"dav"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"bi dav"]);
|
||||||
|
test([OWSContactsManager name:@"big dave" matchesQuery:@"big big big big big big big big big big dave dave dave dave dave"]);
|
||||||
|
|
||||||
|
test(![OWSContactsManager name:@"big dave" matchesQuery:@"ave"]);
|
||||||
|
test(![OWSContactsManager name:@"big dave" matchesQuery:@"dare"]);
|
||||||
|
test(![OWSContactsManager name:@"big dave" matchesQuery:@"mike"]);
|
||||||
|
test(![OWSContactsManager name:@"big dave" matchesQuery:@"mike"]);
|
||||||
|
test(![OWSContactsManager name:@"dave" matchesQuery:@"big"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
Loading…
Reference in New Issue