mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Bye Bye Bloomfilters
For reasons outlined in https://whispersystems.org/blog/contact-discovery/ , Signal will no more use bloom filters for RedPhone contact intersection.
This commit is contained in:
parent
ab86907991
commit
26f9207cab
|
@ -734,6 +734,7 @@
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
EXECUTABLE_PREFIX = lib;
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
ONLY_ACTIVE_ARCH = NO;
|
ONLY_ACTIVE_ARCH = NO;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
@ -745,6 +746,7 @@
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
EXECUTABLE_PREFIX = lib;
|
EXECUTABLE_PREFIX = lib;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
|
|
42
Podfile.lock
42
Podfile.lock
|
@ -1,24 +1,24 @@
|
||||||
PODS:
|
PODS:
|
||||||
- 25519 (2.0.2)
|
- 25519 (2.0.2)
|
||||||
- AFNetworking (2.6.1):
|
- AFNetworking (2.6.3):
|
||||||
- AFNetworking/NSURLConnection (= 2.6.1)
|
- AFNetworking/NSURLConnection (= 2.6.3)
|
||||||
- AFNetworking/NSURLSession (= 2.6.1)
|
- AFNetworking/NSURLSession (= 2.6.3)
|
||||||
- AFNetworking/Reachability (= 2.6.1)
|
- AFNetworking/Reachability (= 2.6.3)
|
||||||
- AFNetworking/Security (= 2.6.1)
|
- AFNetworking/Security (= 2.6.3)
|
||||||
- AFNetworking/Serialization (= 2.6.1)
|
- AFNetworking/Serialization (= 2.6.3)
|
||||||
- AFNetworking/UIKit (= 2.6.1)
|
- AFNetworking/UIKit (= 2.6.3)
|
||||||
- AFNetworking/NSURLConnection (2.6.1):
|
- AFNetworking/NSURLConnection (2.6.3):
|
||||||
- AFNetworking/Reachability
|
- AFNetworking/Reachability
|
||||||
- AFNetworking/Security
|
- AFNetworking/Security
|
||||||
- AFNetworking/Serialization
|
- AFNetworking/Serialization
|
||||||
- AFNetworking/NSURLSession (2.6.1):
|
- AFNetworking/NSURLSession (2.6.3):
|
||||||
- AFNetworking/Reachability
|
- AFNetworking/Reachability
|
||||||
- AFNetworking/Security
|
- AFNetworking/Security
|
||||||
- AFNetworking/Serialization
|
- AFNetworking/Serialization
|
||||||
- AFNetworking/Reachability (2.6.1)
|
- AFNetworking/Reachability (2.6.3)
|
||||||
- AFNetworking/Security (2.6.1)
|
- AFNetworking/Security (2.6.3)
|
||||||
- AFNetworking/Serialization (2.6.1)
|
- AFNetworking/Serialization (2.6.3)
|
||||||
- AFNetworking/UIKit (2.6.1):
|
- AFNetworking/UIKit (2.6.3):
|
||||||
- AFNetworking/NSURLConnection
|
- AFNetworking/NSURLConnection
|
||||||
- AFNetworking/NSURLSession
|
- AFNetworking/NSURLSession
|
||||||
- AxolotlKit (0.7):
|
- AxolotlKit (0.7):
|
||||||
|
@ -40,14 +40,14 @@ PODS:
|
||||||
- JSQMessagesViewController (7.1.0):
|
- JSQMessagesViewController (7.1.0):
|
||||||
- JSQSystemSoundPlayer (~> 2.0.1)
|
- JSQSystemSoundPlayer (~> 2.0.1)
|
||||||
- JSQSystemSoundPlayer (2.0.1)
|
- JSQSystemSoundPlayer (2.0.1)
|
||||||
- libPhoneNumber-iOS (0.8.8)
|
- libPhoneNumber-iOS (0.8.10)
|
||||||
- Mantle (2.0.5):
|
- Mantle (2.0.5):
|
||||||
- Mantle/extobjc (= 2.0.5)
|
- Mantle/extobjc (= 2.0.5)
|
||||||
- Mantle/extobjc (2.0.5)
|
- Mantle/extobjc (2.0.5)
|
||||||
- OpenSSL (1.0.204.1)
|
- OpenSSL (1.0.204.1)
|
||||||
- PastelogKit (1.3):
|
- PastelogKit (1.3):
|
||||||
- CocoaLumberjack (~> 2.0)
|
- CocoaLumberjack (~> 2.0)
|
||||||
- ProtocolBuffers (1.9.9.1)
|
- ProtocolBuffers (1.9.9.2)
|
||||||
- SCWaveformView (1.0.0)
|
- SCWaveformView (1.0.0)
|
||||||
- SocketRocket (0.4.2)
|
- SocketRocket (0.4.2)
|
||||||
- SQLCipher/common (3.1.0)
|
- SQLCipher/common (3.1.0)
|
||||||
|
@ -57,7 +57,7 @@ PODS:
|
||||||
- TwistedOakCollapsingFutures (1.0.0):
|
- TwistedOakCollapsingFutures (1.0.0):
|
||||||
- UnionFind (~> 1.0)
|
- UnionFind (~> 1.0)
|
||||||
- UnionFind (1.0.1)
|
- UnionFind (1.0.1)
|
||||||
- YapDatabase/SQLCipher (2.7.3):
|
- YapDatabase/SQLCipher (2.7.6):
|
||||||
- CocoaLumberjack (~> 2)
|
- CocoaLumberjack (~> 2)
|
||||||
- SQLCipher/fts
|
- SQLCipher/fts
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ CHECKOUT OPTIONS:
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
'25519': dc4bad7e2dbcbf1efa121068a705a44cd98c80fc
|
'25519': dc4bad7e2dbcbf1efa121068a705a44cd98c80fc
|
||||||
AFNetworking: 8e4e60500beb8bec644cf575beee72990a76d399
|
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
|
||||||
AxolotlKit: 8652fca51f4bc8225cbda791b0026c21e912b694
|
AxolotlKit: 8652fca51f4bc8225cbda791b0026c21e912b694
|
||||||
CocoaLumberjack: 17fe8581f84914d5d7e6360f7c70022b173c3ae0
|
CocoaLumberjack: 17fe8581f84914d5d7e6360f7c70022b173c3ae0
|
||||||
DJWActionSheet: 2fe54b1298a7f0fe44462233752c76a530e0cd80
|
DJWActionSheet: 2fe54b1298a7f0fe44462233752c76a530e0cd80
|
||||||
|
@ -107,17 +107,17 @@ SPEC CHECKSUMS:
|
||||||
iRate: 599ed07c854e0695f3c605d1b2a64c67d912acb7
|
iRate: 599ed07c854e0695f3c605d1b2a64c67d912acb7
|
||||||
JSQMessagesViewController: ca11f86fa68ca70835f05e169df9244147c1dc40
|
JSQMessagesViewController: ca11f86fa68ca70835f05e169df9244147c1dc40
|
||||||
JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
|
JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
|
||||||
libPhoneNumber-iOS: fe877b7c44c270a9da2082d3e2892d5316f6a2f9
|
libPhoneNumber-iOS: 7bfd00f843fdcd82b5182b463e8eb3b27579f41d
|
||||||
Mantle: 1912395033f601de5adc8ee91e48f46e4c7051ad
|
Mantle: 1912395033f601de5adc8ee91e48f46e4c7051ad
|
||||||
OpenSSL: 7f853fcada78e5162c2183b4d90ebbd0aa02f5ac
|
OpenSSL: 7f853fcada78e5162c2183b4d90ebbd0aa02f5ac
|
||||||
PastelogKit: 7b475be4cf577713506a943dd940bcc0499c8bca
|
PastelogKit: 7b475be4cf577713506a943dd940bcc0499c8bca
|
||||||
ProtocolBuffers: 1aac782c597fd7b95c5d278df55c34bff2937909
|
ProtocolBuffers: 7111461618460961e6b7469177ec45ee551b4f0e
|
||||||
SCWaveformView: 52a96750255d817e300565a80c81fb643e233e07
|
SCWaveformView: 52a96750255d817e300565a80c81fb643e233e07
|
||||||
SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad
|
SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad
|
||||||
SQLCipher: c44fcca49c31483c2489cfb79aa7a69407f3794a
|
SQLCipher: c44fcca49c31483c2489cfb79aa7a69407f3794a
|
||||||
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
|
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
|
||||||
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c
|
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c
|
||||||
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
|
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
|
||||||
YapDatabase: 6d6a30e97face6c3158830823c27614afe83e1e0
|
YapDatabase: 00e5a5d1b5dba1bd540ef644576233b5612e6122
|
||||||
|
|
||||||
COCOAPODS: 0.38.2
|
COCOAPODS: 0.39.0
|
||||||
|
|
2
Pods
2
Pods
|
@ -1 +1 @@
|
||||||
Subproject commit 0f4532971e696c73005950fa7d9154297fdfa746
|
Subproject commit e6c803ff3cdb391d5c0dc9a2418f1e2f0797a1a3
|
|
@ -151,10 +151,6 @@
|
||||||
76EB060118170B33006006FC /* InitiateSignal.proto in Resources */ = {isa = PBXBuildFile; fileRef = 76EB04A518170B33006006FC /* InitiateSignal.proto */; };
|
76EB060118170B33006006FC /* InitiateSignal.proto in Resources */ = {isa = PBXBuildFile; fileRef = 76EB04A518170B33006006FC /* InitiateSignal.proto */; };
|
||||||
76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
|
76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
|
||||||
76EB060318170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
|
76EB060318170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
|
||||||
76EB060418170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AA18170B33006006FC /* PhoneNumberDirectoryFilter.m */; };
|
|
||||||
76EB060518170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AA18170B33006006FC /* PhoneNumberDirectoryFilter.m */; };
|
|
||||||
76EB060618170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AC18170B33006006FC /* PhoneNumberDirectoryFilterManager.m */; };
|
|
||||||
76EB060718170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AC18170B33006006FC /* PhoneNumberDirectoryFilterManager.m */; };
|
|
||||||
76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */; };
|
76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */; };
|
||||||
76EB060918170B33006006FC /* ResponderSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */; };
|
76EB060918170B33006006FC /* ResponderSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */; };
|
||||||
76EB060A18170B33006006FC /* SignalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04B018170B33006006FC /* SignalUtil.m */; };
|
76EB060A18170B33006006FC /* SignalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04B018170B33006006FC /* SignalUtil.m */; };
|
||||||
|
@ -177,8 +173,6 @@
|
||||||
76EB061B18170B33006006FC /* DiscardingLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04C618170B33006006FC /* DiscardingLog.m */; };
|
76EB061B18170B33006006FC /* DiscardingLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04C618170B33006006FC /* DiscardingLog.m */; };
|
||||||
76EB061C18170B33006006FC /* ArrayUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CA18170B33006006FC /* ArrayUtil.m */; };
|
76EB061C18170B33006006FC /* ArrayUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CA18170B33006006FC /* ArrayUtil.m */; };
|
||||||
76EB061D18170B33006006FC /* ArrayUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CA18170B33006006FC /* ArrayUtil.m */; };
|
76EB061D18170B33006006FC /* ArrayUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CA18170B33006006FC /* ArrayUtil.m */; };
|
||||||
76EB062018170B33006006FC /* BloomFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CE18170B33006006FC /* BloomFilter.m */; };
|
|
||||||
76EB062118170B33006006FC /* BloomFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04CE18170B33006006FC /* BloomFilter.m */; };
|
|
||||||
76EB062218170B33006006FC /* CyclicalBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D118170B33006006FC /* CyclicalBuffer.m */; };
|
76EB062218170B33006006FC /* CyclicalBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D118170B33006006FC /* CyclicalBuffer.m */; };
|
||||||
76EB062318170B33006006FC /* CyclicalBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D118170B33006006FC /* CyclicalBuffer.m */; };
|
76EB062318170B33006006FC /* CyclicalBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D118170B33006006FC /* CyclicalBuffer.m */; };
|
||||||
76EB062418170B33006006FC /* PriorityQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D318170B33006006FC /* PriorityQueue.m */; };
|
76EB062418170B33006006FC /* PriorityQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D318170B33006006FC /* PriorityQueue.m */; };
|
||||||
|
@ -254,7 +248,6 @@
|
||||||
A157077117F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073617F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m */; };
|
A157077117F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073617F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m */; };
|
||||||
A157077217F0CD6D007C2BD6 /* EventWindowTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073817F0CD6D007C2BD6 /* EventWindowTest.m */; };
|
A157077217F0CD6D007C2BD6 /* EventWindowTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073817F0CD6D007C2BD6 /* EventWindowTest.m */; };
|
||||||
A157077417F0CD6D007C2BD6 /* TestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073C17F0CD6D007C2BD6 /* TestUtil.m */; };
|
A157077417F0CD6D007C2BD6 /* TestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073C17F0CD6D007C2BD6 /* TestUtil.m */; };
|
||||||
A157077517F0CD6D007C2BD6 /* BloomFilterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157073F17F0CD6D007C2BD6 /* BloomFilterTest.m */; };
|
|
||||||
A157077717F0CD6D007C2BD6 /* ConversionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074317F0CD6D007C2BD6 /* ConversionsTest.m */; };
|
A157077717F0CD6D007C2BD6 /* ConversionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074317F0CD6D007C2BD6 /* ConversionsTest.m */; };
|
||||||
A157077817F0CD6D007C2BD6 /* Crc32Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074517F0CD6D007C2BD6 /* Crc32Test.m */; };
|
A157077817F0CD6D007C2BD6 /* Crc32Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074517F0CD6D007C2BD6 /* Crc32Test.m */; };
|
||||||
A157077917F0CD6D007C2BD6 /* CryptoToolsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074717F0CD6D007C2BD6 /* CryptoToolsTest.m */; };
|
A157077917F0CD6D007C2BD6 /* CryptoToolsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157074717F0CD6D007C2BD6 /* CryptoToolsTest.m */; };
|
||||||
|
@ -364,7 +357,7 @@
|
||||||
B6B096631A1D25ED008BFAA6 /* TSPreKeyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F11A1D25ED008BFAA6 /* TSPreKeyManager.m */; };
|
B6B096631A1D25ED008BFAA6 /* TSPreKeyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F11A1D25ED008BFAA6 /* TSPreKeyManager.m */; };
|
||||||
B6B096641A1D25ED008BFAA6 /* TSContactThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */; };
|
B6B096641A1D25ED008BFAA6 /* TSContactThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */; };
|
||||||
B6B096651A1D25ED008BFAA6 /* TSGroupThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */; };
|
B6B096651A1D25ED008BFAA6 /* TSGroupThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */; };
|
||||||
B6B096681A1D25ED008BFAA6 /* TSRecipient.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */; };
|
B6B096681A1D25ED008BFAA6 /* SignalRecipient.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FD1A1D25ED008BFAA6 /* SignalRecipient.m */; };
|
||||||
B6B096691A1D25ED008BFAA6 /* TSThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FF1A1D25ED008BFAA6 /* TSThread.m */; };
|
B6B096691A1D25ED008BFAA6 /* TSThread.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095FF1A1D25ED008BFAA6 /* TSThread.m */; };
|
||||||
B6B0966A1A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096021A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; };
|
B6B0966A1A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096021A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; };
|
||||||
B6B0966B1A1D25ED008BFAA6 /* TSAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096041A1D25ED008BFAA6 /* TSAttachment.m */; };
|
B6B0966B1A1D25ED008BFAA6 /* TSAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096041A1D25ED008BFAA6 /* TSAttachment.m */; };
|
||||||
|
@ -400,12 +393,12 @@
|
||||||
B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; };
|
B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; };
|
||||||
B6BADBE41B88CB940086A80D /* TSUpdateAttributesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE31B88CB940086A80D /* TSUpdateAttributesRequest.m */; };
|
B6BADBE41B88CB940086A80D /* TSUpdateAttributesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE31B88CB940086A80D /* TSUpdateAttributesRequest.m */; };
|
||||||
B6BADBE71B88D1AC0086A80D /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */; };
|
B6BADBE71B88D1AC0086A80D /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */; };
|
||||||
B6BE7EED1AB100250038D0C8 /* BloomFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BE7EEC1AB100250038D0C8 /* BloomFilterTests.m */; };
|
|
||||||
B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE531A305ED1006BAF8F /* redphone.cer */; };
|
B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE531A305ED1006BAF8F /* redphone.cer */; };
|
||||||
B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE541A305ED1006BAF8F /* textsecure.cer */; };
|
B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE541A305ED1006BAF8F /* textsecure.cer */; };
|
||||||
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; };
|
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; };
|
||||||
B6DA6B071B8A2F9A00CA6F98 /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */; };
|
B6DA6B071B8A2F9A00CA6F98 /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */; };
|
||||||
B6E314C91A38FAAF00A41AFB /* TSFingerprintGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */; };
|
B6E314C91A38FAAF00A41AFB /* TSFingerprintGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */; };
|
||||||
|
B6E4ECF61C0106DF0014E766 /* ContactsManager+updater.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E4ECF51C0106DF0014E766 /* ContactsManager+updater.m */; };
|
||||||
B6F509971AA53F760068F56A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6F509951AA53F760068F56A /* Localizable.strings */; };
|
B6F509971AA53F760068F56A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6F509951AA53F760068F56A /* Localizable.strings */; };
|
||||||
B6FAAAE81A41BC6C007FEC1D /* TSAttachmentPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FAAAE71A41BC6C007FEC1D /* TSAttachmentPointer.m */; };
|
B6FAAAE81A41BC6C007FEC1D /* TSAttachmentPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FAAAE71A41BC6C007FEC1D /* TSAttachmentPointer.m */; };
|
||||||
B6FAAAEE1A41C918007FEC1D /* TSAttachmentStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FAAAED1A41C918007FEC1D /* TSAttachmentStream.m */; };
|
B6FAAAEE1A41C918007FEC1D /* TSAttachmentStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B6FAAAED1A41C918007FEC1D /* TSAttachmentStream.m */; };
|
||||||
|
@ -690,10 +683,6 @@
|
||||||
76EB04A518170B33006006FC /* InitiateSignal.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InitiateSignal.proto; sourceTree = "<group>"; };
|
76EB04A518170B33006006FC /* InitiateSignal.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InitiateSignal.proto; sourceTree = "<group>"; };
|
||||||
76EB04A618170B33006006FC /* InitiatorSessionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitiatorSessionDescriptor.h; sourceTree = "<group>"; };
|
76EB04A618170B33006006FC /* InitiatorSessionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitiatorSessionDescriptor.h; sourceTree = "<group>"; };
|
||||||
76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InitiatorSessionDescriptor.m; sourceTree = "<group>"; };
|
76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InitiatorSessionDescriptor.m; sourceTree = "<group>"; };
|
||||||
76EB04A918170B33006006FC /* PhoneNumberDirectoryFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberDirectoryFilter.h; sourceTree = "<group>"; };
|
|
||||||
76EB04AA18170B33006006FC /* PhoneNumberDirectoryFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberDirectoryFilter.m; sourceTree = "<group>"; };
|
|
||||||
76EB04AB18170B33006006FC /* PhoneNumberDirectoryFilterManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberDirectoryFilterManager.h; sourceTree = "<group>"; };
|
|
||||||
76EB04AC18170B33006006FC /* PhoneNumberDirectoryFilterManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberDirectoryFilterManager.m; sourceTree = "<group>"; };
|
|
||||||
76EB04AD18170B33006006FC /* ResponderSessionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResponderSessionDescriptor.h; sourceTree = "<group>"; };
|
76EB04AD18170B33006006FC /* ResponderSessionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResponderSessionDescriptor.h; sourceTree = "<group>"; };
|
||||||
76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResponderSessionDescriptor.m; sourceTree = "<group>"; };
|
76EB04AE18170B33006006FC /* ResponderSessionDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResponderSessionDescriptor.m; sourceTree = "<group>"; };
|
||||||
76EB04AF18170B33006006FC /* SignalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalUtil.h; sourceTree = "<group>"; };
|
76EB04AF18170B33006006FC /* SignalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalUtil.h; sourceTree = "<group>"; };
|
||||||
|
@ -720,8 +709,6 @@
|
||||||
76EB04C718170B33006006FC /* ValueLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueLogger.h; sourceTree = "<group>"; };
|
76EB04C718170B33006006FC /* ValueLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueLogger.h; sourceTree = "<group>"; };
|
||||||
76EB04C918170B33006006FC /* ArrayUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayUtil.h; sourceTree = "<group>"; };
|
76EB04C918170B33006006FC /* ArrayUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayUtil.h; sourceTree = "<group>"; };
|
||||||
76EB04CA18170B33006006FC /* ArrayUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayUtil.m; sourceTree = "<group>"; };
|
76EB04CA18170B33006006FC /* ArrayUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayUtil.m; sourceTree = "<group>"; };
|
||||||
76EB04CD18170B33006006FC /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = "<group>"; };
|
|
||||||
76EB04CE18170B33006006FC /* BloomFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BloomFilter.m; sourceTree = "<group>"; };
|
|
||||||
76EB04D018170B33006006FC /* CyclicalBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicalBuffer.h; sourceTree = "<group>"; };
|
76EB04D018170B33006006FC /* CyclicalBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicalBuffer.h; sourceTree = "<group>"; };
|
||||||
76EB04D118170B33006006FC /* CyclicalBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CyclicalBuffer.m; sourceTree = "<group>"; };
|
76EB04D118170B33006006FC /* CyclicalBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CyclicalBuffer.m; sourceTree = "<group>"; };
|
||||||
76EB04D218170B33006006FC /* PriorityQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PriorityQueue.h; sourceTree = "<group>"; };
|
76EB04D218170B33006006FC /* PriorityQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PriorityQueue.h; sourceTree = "<group>"; };
|
||||||
|
@ -802,8 +789,6 @@
|
||||||
A157073A17F0CD6D007C2BD6 /* SignalTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SignalTests-Info.plist"; sourceTree = "<group>"; };
|
A157073A17F0CD6D007C2BD6 /* SignalTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SignalTests-Info.plist"; sourceTree = "<group>"; };
|
||||||
A157073B17F0CD6D007C2BD6 /* TestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestUtil.h; sourceTree = "<group>"; };
|
A157073B17F0CD6D007C2BD6 /* TestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestUtil.h; sourceTree = "<group>"; };
|
||||||
A157073C17F0CD6D007C2BD6 /* TestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestUtil.m; sourceTree = "<group>"; };
|
A157073C17F0CD6D007C2BD6 /* TestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestUtil.m; sourceTree = "<group>"; };
|
||||||
A157073E17F0CD6D007C2BD6 /* BloomFilterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilterTest.h; sourceTree = "<group>"; };
|
|
||||||
A157073F17F0CD6D007C2BD6 /* BloomFilterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BloomFilterTest.m; sourceTree = "<group>"; };
|
|
||||||
A157074217F0CD6D007C2BD6 /* ConversionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionsTest.h; sourceTree = "<group>"; };
|
A157074217F0CD6D007C2BD6 /* ConversionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionsTest.h; sourceTree = "<group>"; };
|
||||||
A157074317F0CD6D007C2BD6 /* ConversionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConversionsTest.m; sourceTree = "<group>"; };
|
A157074317F0CD6D007C2BD6 /* ConversionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConversionsTest.m; sourceTree = "<group>"; };
|
||||||
A157074417F0CD6D007C2BD6 /* Crc32Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crc32Test.h; sourceTree = "<group>"; };
|
A157074417F0CD6D007C2BD6 /* Crc32Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crc32Test.h; sourceTree = "<group>"; };
|
||||||
|
@ -1002,8 +987,8 @@
|
||||||
B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSContactThread.m; sourceTree = "<group>"; };
|
B6B095F51A1D25ED008BFAA6 /* TSContactThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSContactThread.m; sourceTree = "<group>"; };
|
||||||
B6B095F61A1D25ED008BFAA6 /* TSGroupThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGroupThread.h; sourceTree = "<group>"; };
|
B6B095F61A1D25ED008BFAA6 /* TSGroupThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGroupThread.h; sourceTree = "<group>"; };
|
||||||
B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupThread.m; sourceTree = "<group>"; };
|
B6B095F71A1D25ED008BFAA6 /* TSGroupThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupThread.m; sourceTree = "<group>"; };
|
||||||
B6B095FC1A1D25ED008BFAA6 /* TSRecipient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSRecipient.h; sourceTree = "<group>"; };
|
B6B095FC1A1D25ED008BFAA6 /* SignalRecipient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalRecipient.h; sourceTree = "<group>"; };
|
||||||
B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSRecipient.m; sourceTree = "<group>"; };
|
B6B095FD1A1D25ED008BFAA6 /* SignalRecipient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalRecipient.m; sourceTree = "<group>"; };
|
||||||
B6B095FE1A1D25ED008BFAA6 /* TSThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSThread.h; path = ../TSThread.h; sourceTree = "<group>"; };
|
B6B095FE1A1D25ED008BFAA6 /* TSThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSThread.h; path = ../TSThread.h; sourceTree = "<group>"; };
|
||||||
B6B095FF1A1D25ED008BFAA6 /* TSThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSThread.m; path = ../TSThread.m; sourceTree = "<group>"; };
|
B6B095FF1A1D25ED008BFAA6 /* TSThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSThread.m; path = ../TSThread.m; sourceTree = "<group>"; };
|
||||||
B6B096011A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncomingPushMessageSignal.pb.h; sourceTree = "<group>"; };
|
B6B096011A1D25ED008BFAA6 /* IncomingPushMessageSignal.pb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncomingPushMessageSignal.pb.h; sourceTree = "<group>"; };
|
||||||
|
@ -1076,7 +1061,6 @@
|
||||||
B6BADBE51B88D1AC0086A80D /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
|
B6BADBE51B88D1AC0086A80D /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
|
||||||
B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
|
B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
|
||||||
B6BC3D0C1AA544B100C2907F /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = translations/da.lproj/Localizable.strings; sourceTree = "<group>"; };
|
B6BC3D0C1AA544B100C2907F /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = translations/da.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||||
B6BE7EEC1AB100250038D0C8 /* BloomFilterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BloomFilterTests.m; sourceTree = "<group>"; };
|
|
||||||
B6C6AE531A305ED1006BAF8F /* redphone.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = redphone.cer; sourceTree = "<group>"; };
|
B6C6AE531A305ED1006BAF8F /* redphone.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = redphone.cer; sourceTree = "<group>"; };
|
||||||
B6C6AE541A305ED1006BAF8F /* textsecure.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = textsecure.cer; sourceTree = "<group>"; };
|
B6C6AE541A305ED1006BAF8F /* textsecure.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = textsecure.cer; sourceTree = "<group>"; };
|
||||||
B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = "<group>"; };
|
B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = "<group>"; };
|
||||||
|
@ -1085,6 +1069,8 @@
|
||||||
B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppStoreRating.m; sourceTree = "<group>"; };
|
B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppStoreRating.m; sourceTree = "<group>"; };
|
||||||
B6E314C71A38FAAF00A41AFB /* TSFingerprintGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSFingerprintGenerator.h; sourceTree = "<group>"; };
|
B6E314C71A38FAAF00A41AFB /* TSFingerprintGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSFingerprintGenerator.h; sourceTree = "<group>"; };
|
||||||
B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSFingerprintGenerator.m; sourceTree = "<group>"; };
|
B6E314C81A38FAAF00A41AFB /* TSFingerprintGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSFingerprintGenerator.m; sourceTree = "<group>"; };
|
||||||
|
B6E4ECF41C0106DF0014E766 /* ContactsManager+updater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ContactsManager+updater.h"; sourceTree = "<group>"; };
|
||||||
|
B6E4ECF51C0106DF0014E766 /* ContactsManager+updater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ContactsManager+updater.m"; sourceTree = "<group>"; };
|
||||||
B6F509961AA53F760068F56A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = translations/en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
B6F509961AA53F760068F56A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = translations/en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||||
B6FAAAE61A41BC6C007FEC1D /* TSAttachmentPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSAttachmentPointer.h; path = Attachements/TSAttachmentPointer.h; sourceTree = "<group>"; };
|
B6FAAAE61A41BC6C007FEC1D /* TSAttachmentPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSAttachmentPointer.h; path = Attachements/TSAttachmentPointer.h; sourceTree = "<group>"; };
|
||||||
B6FAAAE71A41BC6C007FEC1D /* TSAttachmentPointer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSAttachmentPointer.m; path = Attachements/TSAttachmentPointer.m; sourceTree = "<group>"; };
|
B6FAAAE71A41BC6C007FEC1D /* TSAttachmentPointer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSAttachmentPointer.m; path = Attachements/TSAttachmentPointer.m; sourceTree = "<group>"; };
|
||||||
|
@ -1179,7 +1165,6 @@
|
||||||
E197B62518BBF63B00F073E5 /* SoundBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundBoard.h; sourceTree = "<group>"; };
|
E197B62518BBF63B00F073E5 /* SoundBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundBoard.h; sourceTree = "<group>"; };
|
||||||
E197B62618BBF63B00F073E5 /* SoundBoard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundBoard.m; sourceTree = "<group>"; };
|
E197B62618BBF63B00F073E5 /* SoundBoard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundBoard.m; sourceTree = "<group>"; };
|
||||||
E1A0AD8B16E13FDD0071E604 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
E1A0AD8B16E13FDD0071E604 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||||
E1B3DC731885EFA100B7F794 /* NotificationManifest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationManifest.h; sourceTree = "<group>"; };
|
|
||||||
E1CD329418BCFF9900B1A496 /* SoundInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundInstance.h; sourceTree = "<group>"; };
|
E1CD329418BCFF9900B1A496 /* SoundInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundInstance.h; sourceTree = "<group>"; };
|
||||||
E1CD329518BCFF9900B1A496 /* SoundInstance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundInstance.m; sourceTree = "<group>"; };
|
E1CD329518BCFF9900B1A496 /* SoundInstance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundInstance.m; sourceTree = "<group>"; };
|
||||||
FC3196281A067D8F0094C78E /* MessageComposeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageComposeTableViewController.h; sourceTree = "<group>"; };
|
FC3196281A067D8F0094C78E /* MessageComposeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageComposeTableViewController.h; sourceTree = "<group>"; };
|
||||||
|
@ -1347,7 +1332,6 @@
|
||||||
70DBA29918CFE98500771DAD /* crypto */,
|
70DBA29918CFE98500771DAD /* crypto */,
|
||||||
76EB041118170B33006006FC /* environment */,
|
76EB041118170B33006006FC /* environment */,
|
||||||
76EB041D18170B33006006FC /* network */,
|
76EB041D18170B33006006FC /* network */,
|
||||||
E1B3DC731885EFA100B7F794 /* NotificationManifest.h */,
|
|
||||||
70BAFD5B190584BE00FA5E0B /* NotificationTracker.h */,
|
70BAFD5B190584BE00FA5E0B /* NotificationTracker.h */,
|
||||||
70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */,
|
70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */,
|
||||||
B6B095EA1A1D25ED008BFAA6 /* textsecure */,
|
B6B095EA1A1D25ED008BFAA6 /* textsecure */,
|
||||||
|
@ -1397,6 +1381,8 @@
|
||||||
76EB040518170B33006006FC /* Contact.m */,
|
76EB040518170B33006006FC /* Contact.m */,
|
||||||
76EB040818170B33006006FC /* ContactsManager.h */,
|
76EB040818170B33006006FC /* ContactsManager.h */,
|
||||||
76EB040918170B33006006FC /* ContactsManager.m */,
|
76EB040918170B33006006FC /* ContactsManager.m */,
|
||||||
|
B6E4ECF41C0106DF0014E766 /* ContactsManager+updater.h */,
|
||||||
|
B6E4ECF51C0106DF0014E766 /* ContactsManager+updater.m */,
|
||||||
);
|
);
|
||||||
path = contact;
|
path = contact;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1697,10 +1683,6 @@
|
||||||
children = (
|
children = (
|
||||||
B671B2441A93B238002BBD9D /* GroupContactsResult.h */,
|
B671B2441A93B238002BBD9D /* GroupContactsResult.h */,
|
||||||
B671B2451A93B238002BBD9D /* GroupContactsResult.m */,
|
B671B2451A93B238002BBD9D /* GroupContactsResult.m */,
|
||||||
76EB04A918170B33006006FC /* PhoneNumberDirectoryFilter.h */,
|
|
||||||
76EB04AA18170B33006006FC /* PhoneNumberDirectoryFilter.m */,
|
|
||||||
76EB04AB18170B33006006FC /* PhoneNumberDirectoryFilterManager.h */,
|
|
||||||
76EB04AC18170B33006006FC /* PhoneNumberDirectoryFilterManager.m */,
|
|
||||||
);
|
);
|
||||||
name = "number directory";
|
name = "number directory";
|
||||||
path = "../phone/signaling/number directory";
|
path = "../phone/signaling/number directory";
|
||||||
|
@ -1761,8 +1743,6 @@
|
||||||
FCFA64B11A24F29E0007FB87 /* UI Categories */,
|
FCFA64B11A24F29E0007FB87 /* UI Categories */,
|
||||||
76EB04C918170B33006006FC /* ArrayUtil.h */,
|
76EB04C918170B33006006FC /* ArrayUtil.h */,
|
||||||
76EB04CA18170B33006006FC /* ArrayUtil.m */,
|
76EB04CA18170B33006006FC /* ArrayUtil.m */,
|
||||||
76EB04CD18170B33006006FC /* BloomFilter.h */,
|
|
||||||
76EB04CE18170B33006006FC /* BloomFilter.m */,
|
|
||||||
76EB04CF18170B33006006FC /* collections */,
|
76EB04CF18170B33006006FC /* collections */,
|
||||||
76EB04D618170B33006006FC /* constraints */,
|
76EB04D618170B33006006FC /* constraints */,
|
||||||
76EB04E018170B33006006FC /* Conversions.h */,
|
76EB04E018170B33006006FC /* Conversions.h */,
|
||||||
|
@ -2032,7 +2012,6 @@
|
||||||
children = (
|
children = (
|
||||||
A157073017F0CD6D007C2BD6 /* PhoneNumberTest.m */,
|
A157073017F0CD6D007C2BD6 /* PhoneNumberTest.m */,
|
||||||
A157073117F0CD6D007C2BD6 /* signaling */,
|
A157073117F0CD6D007C2BD6 /* signaling */,
|
||||||
B6BE7EEC1AB100250038D0C8 /* BloomFilterTests.m */,
|
|
||||||
);
|
);
|
||||||
path = phone;
|
path = phone;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -2066,8 +2045,6 @@
|
||||||
A157073D17F0CD6D007C2BD6 /* util */ = {
|
A157073D17F0CD6D007C2BD6 /* util */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A157073E17F0CD6D007C2BD6 /* BloomFilterTest.h */,
|
|
||||||
A157073F17F0CD6D007C2BD6 /* BloomFilterTest.m */,
|
|
||||||
A157074217F0CD6D007C2BD6 /* ConversionsTest.h */,
|
A157074217F0CD6D007C2BD6 /* ConversionsTest.h */,
|
||||||
A157074317F0CD6D007C2BD6 /* ConversionsTest.m */,
|
A157074317F0CD6D007C2BD6 /* ConversionsTest.m */,
|
||||||
A157074417F0CD6D007C2BD6 /* Crc32Test.h */,
|
A157074417F0CD6D007C2BD6 /* Crc32Test.h */,
|
||||||
|
@ -2267,8 +2244,8 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
B6B095F31A1D25ED008BFAA6 /* Threads */,
|
B6B095F31A1D25ED008BFAA6 /* Threads */,
|
||||||
B6B095FC1A1D25ED008BFAA6 /* TSRecipient.h */,
|
B6B095FC1A1D25ED008BFAA6 /* SignalRecipient.h */,
|
||||||
B6B095FD1A1D25ED008BFAA6 /* TSRecipient.m */,
|
B6B095FD1A1D25ED008BFAA6 /* SignalRecipient.m */,
|
||||||
);
|
);
|
||||||
path = Contacts;
|
path = Contacts;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -2684,6 +2661,7 @@
|
||||||
D221A086169C9E5E00537ABF /* Frameworks */,
|
D221A086169C9E5E00537ABF /* Frameworks */,
|
||||||
D221A087169C9E5E00537ABF /* Resources */,
|
D221A087169C9E5E00537ABF /* Resources */,
|
||||||
DC8D50B785074F8FA3DBAACE /* Copy Pods Resources */,
|
DC8D50B785074F8FA3DBAACE /* Copy Pods Resources */,
|
||||||
|
8F3AB5C1386B0A342A82D871 /* Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
|
@ -2704,8 +2682,8 @@
|
||||||
D221A0A5169C9E5F00537ABF /* Sources */,
|
D221A0A5169C9E5F00537ABF /* Sources */,
|
||||||
D221A0A6169C9E5F00537ABF /* Frameworks */,
|
D221A0A6169C9E5F00537ABF /* Frameworks */,
|
||||||
D221A0A7169C9E5F00537ABF /* Resources */,
|
D221A0A7169C9E5F00537ABF /* Resources */,
|
||||||
D221A0A8169C9E5F00537ABF /* ShellScript */,
|
|
||||||
BA4E2805598B464FB7B24430 /* Copy Pods Resources */,
|
BA4E2805598B464FB7B24430 /* Copy Pods Resources */,
|
||||||
|
599E3FF58EB09DC4524C94AE /* Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
|
@ -2902,6 +2880,36 @@
|
||||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
|
599E3FF58EB09DC4524C94AE /* Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Embed Pods Frameworks";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
8F3AB5C1386B0A342A82D871 /* Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Embed Pods Frameworks";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
BA4E2805598B464FB7B24430 /* Copy Pods Resources */ = {
|
BA4E2805598B464FB7B24430 /* Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
@ -2917,19 +2925,6 @@
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
D221A0A8169C9E5F00537ABF /* ShellScript */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
|
|
||||||
};
|
|
||||||
DC8D50B785074F8FA3DBAACE /* Copy Pods Resources */ = {
|
DC8D50B785074F8FA3DBAACE /* Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
@ -3004,6 +2999,7 @@
|
||||||
76EB05EC18170B33006006FC /* CallState.m in Sources */,
|
76EB05EC18170B33006006FC /* CallState.m in Sources */,
|
||||||
76EB05D218170B33006006FC /* ZrtpInitiator.m in Sources */,
|
76EB05D218170B33006006FC /* ZrtpInitiator.m in Sources */,
|
||||||
76EB05E018170B33006006FC /* NetworkStream.m in Sources */,
|
76EB05E018170B33006006FC /* NetworkStream.m in Sources */,
|
||||||
|
B6E4ECF61C0106DF0014E766 /* ContactsManager+updater.m in Sources */,
|
||||||
B62EFBEE1A91352F0072ADD3 /* TSInvalidIdentityKeySendingErrorMessage.m in Sources */,
|
B62EFBEE1A91352F0072ADD3 /* TSInvalidIdentityKeySendingErrorMessage.m in Sources */,
|
||||||
B6B0968A1A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m in Sources */,
|
B6B0968A1A1D25ED008BFAA6 /* TSStorageManager+SessionStore.m in Sources */,
|
||||||
FCFA64B71A24F6730007FB87 /* UIFont+OWS.m in Sources */,
|
FCFA64B71A24F6730007FB87 /* UIFont+OWS.m in Sources */,
|
||||||
|
@ -3054,7 +3050,7 @@
|
||||||
76EB063018170B33006006FC /* Conversions.m in Sources */,
|
76EB063018170B33006006FC /* Conversions.m in Sources */,
|
||||||
76EB065618170B34006006FC /* InCallViewController.m in Sources */,
|
76EB065618170B34006006FC /* InCallViewController.m in Sources */,
|
||||||
B63006431B9631EC00F2FEB5 /* AFSecurityOWSPolicy.m in Sources */,
|
B63006431B9631EC00F2FEB5 /* AFSecurityOWSPolicy.m in Sources */,
|
||||||
B6B096681A1D25ED008BFAA6 /* TSRecipient.m in Sources */,
|
B6B096681A1D25ED008BFAA6 /* SignalRecipient.m in Sources */,
|
||||||
76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */,
|
76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */,
|
||||||
76EB05CA18170B33006006FC /* RecipientUnavailable.m in Sources */,
|
76EB05CA18170B33006006FC /* RecipientUnavailable.m in Sources */,
|
||||||
B692BF071A76EF0F002786DA /* TSDatabaseSecondaryIndexes.m in Sources */,
|
B692BF071A76EF0F002786DA /* TSDatabaseSecondaryIndexes.m in Sources */,
|
||||||
|
@ -3151,7 +3147,6 @@
|
||||||
B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */,
|
B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */,
|
||||||
E197B62118BBF12700F073E5 /* AppAudioManager.m in Sources */,
|
E197B62118BBF12700F073E5 /* AppAudioManager.m in Sources */,
|
||||||
FC4FA0261A1B9DC600DA100A /* SignalsNavigationController.m in Sources */,
|
FC4FA0261A1B9DC600DA100A /* SignalsNavigationController.m in Sources */,
|
||||||
76EB062018170B33006006FC /* BloomFilter.m in Sources */,
|
|
||||||
B63AF5D31A1F757900D01AAD /* TSSocketManager.m in Sources */,
|
B63AF5D31A1F757900D01AAD /* TSSocketManager.m in Sources */,
|
||||||
76EB063818170B33006006FC /* DictionaryUtil.m in Sources */,
|
76EB063818170B33006006FC /* DictionaryUtil.m in Sources */,
|
||||||
76EB05CE18170B33006006FC /* ZrtpHandshakeResult.m in Sources */,
|
76EB05CE18170B33006006FC /* ZrtpHandshakeResult.m in Sources */,
|
||||||
|
@ -3178,7 +3173,6 @@
|
||||||
FCD274E21A5AFD8000202277 /* PrivacySettingsTableViewController.m in Sources */,
|
FCD274E21A5AFD8000202277 /* PrivacySettingsTableViewController.m in Sources */,
|
||||||
76EB057218170B33006006FC /* RecentCall.m in Sources */,
|
76EB057218170B33006006FC /* RecentCall.m in Sources */,
|
||||||
B62EFBED1A91352F0072ADD3 /* TSInvalidIdentityKeyReceivingErrorMessage.m in Sources */,
|
B62EFBED1A91352F0072ADD3 /* TSInvalidIdentityKeyReceivingErrorMessage.m in Sources */,
|
||||||
76EB060418170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */,
|
|
||||||
B97CBFA818860EA3008E0DE9 /* CountryCodeViewController.m in Sources */,
|
B97CBFA818860EA3008E0DE9 /* CountryCodeViewController.m in Sources */,
|
||||||
B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */,
|
B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */,
|
||||||
76EB059218170B33006006FC /* UnrecognizedRequestFailure.m in Sources */,
|
76EB059218170B33006006FC /* UnrecognizedRequestFailure.m in Sources */,
|
||||||
|
@ -3194,7 +3188,6 @@
|
||||||
B6B096721A1D25ED008BFAA6 /* TSMessage.m in Sources */,
|
B6B096721A1D25ED008BFAA6 /* TSMessage.m in Sources */,
|
||||||
76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */,
|
76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */,
|
||||||
76EB05B218170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */,
|
76EB05B218170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */,
|
||||||
76EB060618170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */,
|
|
||||||
B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */,
|
B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */,
|
||||||
76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */,
|
76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */,
|
||||||
B90418E6183E9DD40038554A /* DateUtil.m in Sources */,
|
B90418E6183E9DD40038554A /* DateUtil.m in Sources */,
|
||||||
|
@ -3244,7 +3237,6 @@
|
||||||
76EB058B18170B33006006FC /* Release.m in Sources */,
|
76EB058B18170B33006006FC /* Release.m in Sources */,
|
||||||
76EB05D318170B33006006FC /* ZrtpInitiator.m in Sources */,
|
76EB05D318170B33006006FC /* ZrtpInitiator.m in Sources */,
|
||||||
76EB061518170B33006006FC /* AnonymousConditionLogger.m in Sources */,
|
76EB061518170B33006006FC /* AnonymousConditionLogger.m in Sources */,
|
||||||
76EB060718170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */,
|
|
||||||
76EB05A118170B33006006FC /* IpAddress.m in Sources */,
|
76EB05A118170B33006006FC /* IpAddress.m in Sources */,
|
||||||
76EB05CD18170B33006006FC /* ShortAuthenticationStringGenerator.m in Sources */,
|
76EB05CD18170B33006006FC /* ShortAuthenticationStringGenerator.m in Sources */,
|
||||||
76EB05B718170B33006006FC /* MasterSecret.m in Sources */,
|
76EB05B718170B33006006FC /* MasterSecret.m in Sources */,
|
||||||
|
@ -3253,7 +3245,6 @@
|
||||||
A157075717F0CD6D007C2BD6 /* AudioFrameTest.m in Sources */,
|
A157075717F0CD6D007C2BD6 /* AudioFrameTest.m in Sources */,
|
||||||
76EB063F18170B33006006FC /* Operation.m in Sources */,
|
76EB063F18170B33006006FC /* Operation.m in Sources */,
|
||||||
76EB05AB18170B33006006FC /* SequenceCounter.m in Sources */,
|
76EB05AB18170B33006006FC /* SequenceCounter.m in Sources */,
|
||||||
B6BE7EED1AB100250038D0C8 /* BloomFilterTests.m in Sources */,
|
|
||||||
76EB061D18170B33006006FC /* ArrayUtil.m in Sources */,
|
76EB061D18170B33006006FC /* ArrayUtil.m in Sources */,
|
||||||
76EB05E318170B33006006FC /* SecureEndPoint.m in Sources */,
|
76EB05E318170B33006006FC /* SecureEndPoint.m in Sources */,
|
||||||
76EB060D18170B33006006FC /* CategorizingLogger.m in Sources */,
|
76EB060D18170B33006006FC /* CategorizingLogger.m in Sources */,
|
||||||
|
@ -3279,7 +3270,6 @@
|
||||||
76EB05C518170B33006006FC /* HandshakePacket.m in Sources */,
|
76EB05C518170B33006006FC /* HandshakePacket.m in Sources */,
|
||||||
76EB058F18170B33006006FC /* HostNameEndPoint.m in Sources */,
|
76EB058F18170B33006006FC /* HostNameEndPoint.m in Sources */,
|
||||||
B640C4771A477B0F005C7C8A /* TSAttachementsTest.m in Sources */,
|
B640C4771A477B0F005C7C8A /* TSAttachementsTest.m in Sources */,
|
||||||
76EB062118170B33006006FC /* BloomFilter.m in Sources */,
|
|
||||||
76EB064518170B33006006FC /* ThreadManager.m in Sources */,
|
76EB064518170B33006006FC /* ThreadManager.m in Sources */,
|
||||||
76EB068718170B34006006FC /* ContactTableViewCell.m in Sources */,
|
76EB068718170B34006006FC /* ContactTableViewCell.m in Sources */,
|
||||||
76EB063B18170B33006006FC /* FunctionalUtil.m in Sources */,
|
76EB063B18170B33006006FC /* FunctionalUtil.m in Sources */,
|
||||||
|
@ -3293,7 +3283,6 @@
|
||||||
76EB05F918170B33006006FC /* CallConnectUtil_Initiator.m in Sources */,
|
76EB05F918170B33006006FC /* CallConnectUtil_Initiator.m in Sources */,
|
||||||
A157076717F0CD6D007C2BD6 /* MasterSecretTest.m in Sources */,
|
A157076717F0CD6D007C2BD6 /* MasterSecretTest.m in Sources */,
|
||||||
76EB05CF18170B33006006FC /* ZrtpHandshakeResult.m in Sources */,
|
76EB05CF18170B33006006FC /* ZrtpHandshakeResult.m in Sources */,
|
||||||
76EB060518170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */,
|
|
||||||
A157076817F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m in Sources */,
|
A157076817F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m in Sources */,
|
||||||
76EB065718170B34006006FC /* InCallViewController.m in Sources */,
|
76EB065718170B34006006FC /* InCallViewController.m in Sources */,
|
||||||
A157076917F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.m in Sources */,
|
A157076917F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.m in Sources */,
|
||||||
|
@ -3329,7 +3318,6 @@
|
||||||
A157077117F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m in Sources */,
|
A157077117F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m in Sources */,
|
||||||
A157077217F0CD6D007C2BD6 /* EventWindowTest.m in Sources */,
|
A157077217F0CD6D007C2BD6 /* EventWindowTest.m in Sources */,
|
||||||
A157077417F0CD6D007C2BD6 /* TestUtil.m in Sources */,
|
A157077417F0CD6D007C2BD6 /* TestUtil.m in Sources */,
|
||||||
A157077517F0CD6D007C2BD6 /* BloomFilterTest.m in Sources */,
|
|
||||||
76EB05E918170B33006006FC /* CallFailedServerMessage.m in Sources */,
|
76EB05E918170B33006006FC /* CallFailedServerMessage.m in Sources */,
|
||||||
76EB058718170B33006006FC /* PreferencesUtil.m in Sources */,
|
76EB058718170B33006006FC /* PreferencesUtil.m in Sources */,
|
||||||
76EB064118170B33006006FC /* AnonymousTerminator.m in Sources */,
|
76EB064118170B33006006FC /* AnonymousTerminator.m in Sources */,
|
||||||
|
@ -3454,6 +3442,7 @@
|
||||||
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
|
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "compiler-default";
|
CLANG_CXX_LIBRARY = "compiler-default";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
@ -3523,6 +3512,7 @@
|
||||||
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
|
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "compiler-default";
|
CLANG_CXX_LIBRARY = "compiler-default";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
@ -3688,7 +3678,9 @@
|
||||||
baseConfigurationReference = 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */;
|
baseConfigurationReference = 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
||||||
|
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
|
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
|
||||||
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
||||||
|
@ -3738,7 +3730,9 @@
|
||||||
baseConfigurationReference = 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */;
|
baseConfigurationReference = 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
||||||
|
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
|
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
|
||||||
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.2</string>
|
<string>2.3</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.2.0</string>
|
<string>2.3.0</string>
|
||||||
<key>LOGS_EMAIL</key>
|
<key>LOGS_EMAIL</key>
|
||||||
<string>support@whispersystems.org</string>
|
<string>support@whispersystems.org</string>
|
||||||
<key>LOGS_URL</key>
|
<key>LOGS_URL</key>
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#define SignalAlertView(title,msg) [[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil] show]
|
#define SignalAlertView(title,msg) [[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil] show]
|
||||||
#define SignalReportError [Pastelog reportErrorAndSubmitLogsWithAlertTitle:NSLocalizedString(@"ERROR_WAS_DETECTED_TITLE", @"") alertBody:NSLocalizedString(@"ERROR_WAS_DETECTED_SUBMIT", @"")];
|
#define SignalReportError [Pastelog reportErrorAndSubmitLogsWithAlertTitle:NSLocalizedString(@"ERROR_WAS_DETECTED_TITLE", @"") alertBody:NSLocalizedString(@"ERROR_WAS_DETECTED_SUBMIT", @"")];
|
||||||
|
|
||||||
#define BLOCK_SAFE_RUN(block, ...) block ? block(__VA_ARGS__) : nil
|
#define BLOCK_SAFE_RUN(block, ...) block ? dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{block(__VA_ARGS__);}) : nil
|
||||||
|
#define SYNC_BLOCK_SAFE_RUN(block, ...) block ? block(__VA_ARGS__): nil
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#import "ContactsManager.h"
|
#import "ContactsManager.h"
|
||||||
#import "DebugLogger.h"
|
#import "DebugLogger.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
#import "PreferencesUtil.h"
|
#import "PreferencesUtil.h"
|
||||||
#import "PushManager.h"
|
#import "PushManager.h"
|
||||||
#import "Release.h"
|
#import "Release.h"
|
||||||
|
@ -49,7 +48,6 @@ static NSString * const kURLHostVerifyPrefix = @"verify";
|
||||||
CategorizingLogger* logger = [CategorizingLogger categorizingLogger];
|
CategorizingLogger* logger = [CategorizingLogger categorizingLogger];
|
||||||
[logger addLoggingCallback:^(NSString *category, id details, NSUInteger index) {}];
|
[logger addLoggingCallback:^(NSString *category, id details, NSUInteger index) {}];
|
||||||
[Environment setCurrent:[Release releaseEnvironmentWithLogging:logger]];
|
[Environment setCurrent:[Release releaseEnvironmentWithLogging:logger]];
|
||||||
[Environment.getCurrent.phoneDirectoryManager startUntilCancelled:nil];
|
|
||||||
|
|
||||||
if ([TSAccountManager isRegistered]) {
|
if ([TSAccountManager isRegistered]) {
|
||||||
[Environment.getCurrent.contactsManager doAfterEnvironmentInitSetup];
|
[Environment.getCurrent.contactsManager doAfterEnvironmentInitSetup];
|
||||||
|
@ -104,7 +102,6 @@ static NSString * const kURLHostVerifyPrefix = @"verify";
|
||||||
}
|
}
|
||||||
|
|
||||||
[[PushManager sharedManager] validateUserNotificationSettings];
|
[[PushManager sharedManager] validateUserNotificationSettings];
|
||||||
[self refreshContacts];
|
|
||||||
[TSPreKeyManager refreshPreKeys];
|
[TSPreKeyManager refreshPreKeys];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,12 +264,6 @@ performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)refreshContacts {
|
|
||||||
Environment *env = [Environment getCurrent];
|
|
||||||
PhoneNumberDirectoryFilterManager *manager = [env phoneDirectoryManager];
|
|
||||||
[manager forceUpdate];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark Push Notifications Delegate Methods
|
#pragma mark Push Notifications Delegate Methods
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
/**
|
|
||||||
Stores All String Constants Used for NS Notifications
|
|
||||||
**/
|
|
||||||
|
|
||||||
#ifndef RedPhone_NotificationManifest_h
|
|
||||||
#define RedPhone_NotificationManifest_h
|
|
||||||
|
|
||||||
#define NOTIFICATION_DIRECTORY_UPDATE @"NOTIFICATION_DIRECTORY_UPDATE"
|
|
||||||
#define NOTIFICATION_DIRECTORY_WAS_UPDATED @"NOTIFICATION_DIRECTORY_WAS_UPDATED"
|
|
||||||
#define NOTIFICATION_DIRECTORY_FAILED @"NOTIFICATION_DIRECTORY_FAILED"
|
|
||||||
#define NOTIFICATION_NEW_USERS_AVAILABLE @"NOTIFICATION_NEW_USERS_AVAILABLE"
|
|
||||||
|
|
||||||
|
|
||||||
#define NOTIFICATION_DATAKEY_NEW_USERS @"NOTIFICATION_DATAKEY_NEW_USERS"
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,7 +1,7 @@
|
||||||
#import "Contact.h"
|
#import "Contact.h"
|
||||||
#import "ContactsManager.h"
|
#import "ContactsManager.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "TSRecipient.h"
|
#import "SignalRecipient.h"
|
||||||
|
|
||||||
static NSString *const DEFAULTS_KEY_CONTACT = @"DefaultsKeyContact";
|
static NSString *const DEFAULTS_KEY_CONTACT = @"DefaultsKeyContact";
|
||||||
static NSString *const DEFAULTS_KEY_PHONE_NUMBER = @"DefaultsKeyPhoneNumber";
|
static NSString *const DEFAULTS_KEY_PHONE_NUMBER = @"DefaultsKeyPhoneNumber";
|
||||||
|
@ -85,16 +85,13 @@ static NSString *const DEFAULTS_KEY_DATE = @"DefaultsKeyDate";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isTextSecureContact{
|
- (BOOL)isTextSecureContact{
|
||||||
__block BOOL isRecipient = NO;
|
NSArray *identifiers = [self textSecureIdentifiers];
|
||||||
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
|
||||||
for (PhoneNumber *number in self.parsedPhoneNumbers) {
|
if ([identifiers count] > 0) {
|
||||||
if ([TSRecipient recipientWithTextSecureIdentifier:number.toE164 withTransaction:transaction]) {
|
return YES;
|
||||||
isRecipient = YES;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}];
|
return NO;
|
||||||
return isRecipient;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*)textSecureIdentifiers{
|
- (NSArray*)textSecureIdentifiers{
|
||||||
|
@ -102,7 +99,7 @@ static NSString *const DEFAULTS_KEY_DATE = @"DefaultsKeyDate";
|
||||||
|
|
||||||
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||||
for (PhoneNumber *number in self.parsedPhoneNumbers) {
|
for (PhoneNumber *number in self.parsedPhoneNumbers) {
|
||||||
if ([TSRecipient recipientWithTextSecureIdentifier:number.toE164 withTransaction:transaction]) {
|
if ([SignalRecipient recipientWithTextSecureIdentifier:number.toE164 withTransaction:transaction]) {
|
||||||
[identifiers addObject:number.toE164];
|
[identifiers addObject:number.toE164];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,20 +108,26 @@ static NSString *const DEFAULTS_KEY_DATE = @"DefaultsKeyDate";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isRedPhoneContact{
|
- (BOOL)isRedPhoneContact{
|
||||||
ContactsManager *contactManager = [Environment getCurrent].contactsManager;
|
NSArray *identifiers = [self redPhoneIdentifiers];
|
||||||
return [contactManager isContactRegisteredWithRedPhone:self];
|
|
||||||
|
if ([identifiers count] > 0) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *)redPhoneIdentifiers{
|
- (NSArray *)redPhoneIdentifiers{
|
||||||
__block NSMutableArray *identifiers = [NSMutableArray array];
|
__block NSMutableArray *identifiers = [NSMutableArray array];
|
||||||
|
|
||||||
ContactsManager *contactManager = [Environment getCurrent].contactsManager;
|
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||||
for (PhoneNumber *number in self.parsedPhoneNumbers) {
|
for (PhoneNumber *number in self.parsedPhoneNumbers) {
|
||||||
if ([contactManager isPhoneNumberRegisteredWithRedPhone:number]) {
|
SignalRecipient *recipient = [SignalRecipient recipientWithTextSecureIdentifier:number.toE164 withTransaction:transaction];
|
||||||
[identifiers addObject:number];
|
if (recipient && recipient.supportsVoice) {
|
||||||
|
[identifiers addObject:number.toE164];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
return identifiers;
|
return identifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
27
Signal/src/contact/ContactsManager+updater.h
Normal file
27
Signal/src/contact/ContactsManager+updater.h
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// ContactsManager+updater.h
|
||||||
|
// Signal
|
||||||
|
//
|
||||||
|
// Created by Frederic Jacobs on 21/11/15.
|
||||||
|
// Copyright © 2015 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SignalRecipient.h"
|
||||||
|
#import "ContactsManager.h"
|
||||||
|
|
||||||
|
@interface ContactsManager (updater)
|
||||||
|
|
||||||
|
#define NOTFOUND_ERROR 777404
|
||||||
|
|
||||||
|
- (void)intersectContacts;
|
||||||
|
- (void)synchronousLookup:(NSString*)identifier
|
||||||
|
success:(void (^)(SignalRecipient*))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
- (void)lookupIdentifier:(NSString*)identifier
|
||||||
|
success:(void (^)(NSSet<NSString*> *matchedIds))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
- (void)updateSignalContactIntersectionWithSuccess:(void (^)())success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
@end
|
184
Signal/src/contact/ContactsManager+updater.m
Normal file
184
Signal/src/contact/ContactsManager+updater.m
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
//
|
||||||
|
// ContactsManager+updater.m
|
||||||
|
// Signal
|
||||||
|
//
|
||||||
|
// Created by Frederic Jacobs on 21/11/15.
|
||||||
|
// Copyright © 2015 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ContactsManager+updater.h"
|
||||||
|
|
||||||
|
#import "Cryptography.h"
|
||||||
|
#import "Environment.h"
|
||||||
|
#import "TSContactsIntersectionRequest.h"
|
||||||
|
#import "TSNetworkManager.h"
|
||||||
|
|
||||||
|
@implementation ContactsManager (updater)
|
||||||
|
|
||||||
|
- (void)synchronousLookup:(NSString*)identifier
|
||||||
|
success:(void (^)(SignalRecipient*))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
__block dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
||||||
|
__block SignalRecipient *recipient = nil;
|
||||||
|
__block NSError *error = nil;
|
||||||
|
|
||||||
|
[self lookupIdentifier:identifier
|
||||||
|
success:^(NSSet<NSString *> *matchedIds) {
|
||||||
|
if ([matchedIds count] == 1) {
|
||||||
|
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction * _Nonnull transaction) {
|
||||||
|
recipient = [SignalRecipient recipientWithTextSecureIdentifier:identifier withTransaction:transaction];
|
||||||
|
}];
|
||||||
|
} else {
|
||||||
|
error = [NSError errorWithDomain:@"contactsmanager.notfound" code:NOTFOUND_ERROR userInfo:nil];
|
||||||
|
}
|
||||||
|
dispatch_semaphore_signal(sema);
|
||||||
|
} failure:^(NSError *blockerror) {
|
||||||
|
error = blockerror;
|
||||||
|
dispatch_semaphore_signal(sema);
|
||||||
|
}];
|
||||||
|
|
||||||
|
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
||||||
|
if (error) {
|
||||||
|
SYNC_BLOCK_SAFE_RUN(failure, error);
|
||||||
|
} else {
|
||||||
|
SYNC_BLOCK_SAFE_RUN(success, recipient);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- (void)lookupIdentifier:(NSString*)identifier
|
||||||
|
success:(void (^)(NSSet<NSString*> *matchedIds))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
[self contactIntersectionWithSet:[NSSet setWithObject:identifier]
|
||||||
|
success:^(NSSet<NSString *> *matchedIds){
|
||||||
|
BLOCK_SAFE_RUN(success, matchedIds);
|
||||||
|
}
|
||||||
|
failure:^(NSError *error) {
|
||||||
|
BLOCK_SAFE_RUN(failure, error);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)intersectContacts {
|
||||||
|
[self updateSignalContactIntersectionWithSuccess:nil failure:^(NSError *error) {
|
||||||
|
[NSTimer scheduledTimerWithTimeInterval:60
|
||||||
|
target:self
|
||||||
|
selector:@selector(intersectContacts)
|
||||||
|
userInfo:nil
|
||||||
|
repeats:NO];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateSignalContactIntersectionWithSuccess:(void (^)())success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
NSArray<Contact*> *abContacts = [[[Environment getCurrent] contactsManager] allContacts];
|
||||||
|
NSMutableSet<NSString*> *abPhoneNumbers = [NSMutableSet set];
|
||||||
|
|
||||||
|
for (Contact *contact in abContacts) {
|
||||||
|
for (PhoneNumber *phoneNumber in contact.parsedPhoneNumbers) {
|
||||||
|
[abPhoneNumbers addObject:phoneNumber.toE164];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__block NSMutableSet *recipientIds = [NSMutableSet set];
|
||||||
|
[[TSStorageManager sharedManager].dbConnection readWithBlock:^(YapDatabaseReadTransaction * _Nonnull transaction) {
|
||||||
|
NSArray *allRecipientKeys = [transaction allKeysInCollection:[SignalRecipient collection]];
|
||||||
|
[recipientIds addObjectsFromArray:allRecipientKeys];
|
||||||
|
}];
|
||||||
|
|
||||||
|
NSMutableSet<NSString*> *allContacts = [[abPhoneNumbers setByAddingObjectsFromSet:recipientIds] mutableCopy];
|
||||||
|
|
||||||
|
[self contactIntersectionWithSet:allContacts
|
||||||
|
success:^(NSSet<NSString *> *matchedIds) {
|
||||||
|
[recipientIds minusSet:matchedIds];
|
||||||
|
|
||||||
|
// Cleaning up unregistered identifiers
|
||||||
|
[[TSStorageManager sharedManager].dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction * _Nonnull transaction) {
|
||||||
|
for (NSString *identifier in recipientIds) {
|
||||||
|
SignalRecipient *recipient = [SignalRecipient fetchObjectWithUniqueID:identifier transaction:transaction];
|
||||||
|
[recipient removeWithTransaction:transaction];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
BLOCK_SAFE_RUN(success);
|
||||||
|
} failure:^(NSError *error) {
|
||||||
|
BLOCK_SAFE_RUN(failure, error);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) contactIntersectionWithSet:(NSSet<NSString*>*)idSet
|
||||||
|
success:(void (^)(NSSet<NSString*> *matchedIds))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
NSMutableDictionary *phoneNumbersByHashes = [NSMutableDictionary dictionary];
|
||||||
|
for (NSString *identifier in idSet) {
|
||||||
|
[phoneNumbersByHashes setObject:identifier
|
||||||
|
forKey:[Cryptography truncatedSHA1Base64EncodedWithoutPadding:identifier]];
|
||||||
|
}
|
||||||
|
NSArray *hashes = [phoneNumbersByHashes allKeys];
|
||||||
|
|
||||||
|
TSRequest *request = [[TSContactsIntersectionRequest alloc] initWithHashesArray:hashes];
|
||||||
|
[[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *tsTask, id responseDict) {
|
||||||
|
NSMutableDictionary *attributesForIdentifier = [NSMutableDictionary dictionary];
|
||||||
|
NSArray *contactsArray = [(NSDictionary*)responseDict objectForKey:@"contacts"];
|
||||||
|
|
||||||
|
// Map attributes to phone numbers
|
||||||
|
if (contactsArray) {
|
||||||
|
for (NSDictionary *dict in contactsArray) {
|
||||||
|
NSString *hash = [dict objectForKey:@"token"];
|
||||||
|
NSString *identifier = [phoneNumbersByHashes objectForKey:hash];
|
||||||
|
|
||||||
|
if (!identifier) {
|
||||||
|
DDLogWarn(@"An interesecting hash wasn't found in the mapping.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
[attributesForIdentifier setObject:dict forKey:identifier];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert or update contact attributes
|
||||||
|
[[TSStorageManager sharedManager].dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
for (NSString *identifier in attributesForIdentifier) {
|
||||||
|
SignalRecipient *recipient = [SignalRecipient recipientWithTextSecureIdentifier:identifier
|
||||||
|
withTransaction:transaction];
|
||||||
|
if (!recipient) {
|
||||||
|
recipient = [[SignalRecipient alloc] initWithTextSecureIdentifier:identifier
|
||||||
|
relay:nil
|
||||||
|
supportsVoice:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
NSDictionary *attributes = [attributesForIdentifier objectForKey:identifier];
|
||||||
|
|
||||||
|
NSString *relay = [attributes objectForKey:@"relay"];
|
||||||
|
if (relay) {
|
||||||
|
recipient.relay = relay;
|
||||||
|
} else {
|
||||||
|
recipient.relay = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL supportsVoice = [[attributes objectForKey:@"voice"] boolValue];
|
||||||
|
if (supportsVoice) {
|
||||||
|
recipient.supportsVoice = YES;
|
||||||
|
} else {
|
||||||
|
recipient.supportsVoice = NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
[recipient saveWithTransaction:transaction];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
BLOCK_SAFE_RUN(success, [NSSet setWithArray:attributesForIdentifier.allKeys]);
|
||||||
|
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
||||||
|
BLOCK_SAFE_RUN(failure, error);
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -14,13 +14,14 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define SIGNAL_LIST_UPDATED @"Signal_AB_UPDATED"
|
||||||
|
|
||||||
typedef void(^ABAccessRequestCompletionBlock)(BOOL hasAccess);
|
typedef void(^ABAccessRequestCompletionBlock)(BOOL hasAccess);
|
||||||
typedef void(^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
typedef void(^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
||||||
|
|
||||||
@interface ContactsManager : NSObject {
|
@interface ContactsManager : NSObject {
|
||||||
@private TOCFuture* futureAddressBook;
|
@private TOCFuture* futureAddressBook;
|
||||||
@private ObservableValueController* observableContactsController;
|
@private ObservableValueController* observableContactsController;
|
||||||
@private ObservableValueController* observableRedPhoneUsersController;
|
|
||||||
@private ObservableValueController* observableTextSecureUsersController;
|
@private ObservableValueController* observableTextSecureUsersController;
|
||||||
@private TOCCancelTokenSource* life;
|
@private TOCCancelTokenSource* life;
|
||||||
@private NSDictionary *latestContactsById;
|
@private NSDictionary *latestContactsById;
|
||||||
|
@ -30,9 +31,7 @@ typedef void(^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
||||||
@property CNContactStore *contactStore;
|
@property CNContactStore *contactStore;
|
||||||
|
|
||||||
-(ObservableValue *) getObservableContacts;
|
-(ObservableValue *) getObservableContacts;
|
||||||
-(ObservableValue *) getObservableRedPhoneUsers;
|
//-(ObservableValue *) getObservableRedPhoneUsers;
|
||||||
|
|
||||||
- (BOOL)isPhoneNumberRegisteredWithRedPhone:(PhoneNumber*)phoneNumber;
|
|
||||||
|
|
||||||
-(NSArray*) getContactsFromAddressBook:(ABAddressBookRef)addressBook;
|
-(NSArray*) getContactsFromAddressBook:(ABAddressBookRef)addressBook;
|
||||||
-(Contact*) latestContactWithRecordId:(ABRecordID)recordId;
|
-(Contact*) latestContactWithRecordId:(ABRecordID)recordId;
|
||||||
|
@ -46,12 +45,10 @@ typedef void(^ABReloadRequestCompletionBlock)(NSArray *contacts);
|
||||||
|
|
||||||
- (void)verifyABPermission;
|
- (void)verifyABPermission;
|
||||||
|
|
||||||
- (NSArray*)allContacts;
|
- (NSArray<Contact *> *)allContacts;
|
||||||
- (NSArray*)signalContacts;
|
- (NSArray*)signalContacts;
|
||||||
- (NSArray*)textSecureContacts;
|
- (NSArray*)textSecureContacts;
|
||||||
|
|
||||||
- (BOOL)isContactRegisteredWithRedPhone:(Contact*)contact;
|
|
||||||
|
|
||||||
-(void)doAfterEnvironmentInitSetup;
|
-(void)doAfterEnvironmentInitSetup;
|
||||||
|
|
||||||
- (NSString*)nameStringForPhoneIdentifier:(NSString*)identifier;
|
- (NSString*)nameStringForPhoneIdentifier:(NSString*)identifier;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#import "ContactsManager.h"
|
#import "ContactsManager+updater.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "NotificationManifest.h"
|
|
||||||
#import "PhoneNumberDirectoryFilter.h"
|
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
#import "Util.h"
|
#import "Util.h"
|
||||||
|
|
||||||
#define ADDRESSBOOK_QUEUE dispatch_get_main_queue()
|
#define ADDRESSBOOK_QUEUE dispatch_get_main_queue()
|
||||||
|
@ -22,8 +19,6 @@ typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL*);
|
||||||
if (self) {
|
if (self) {
|
||||||
life = [TOCCancelTokenSource new];
|
life = [TOCCancelTokenSource new];
|
||||||
observableContactsController = [ObservableValueController observableValueControllerWithInitialValue:nil];
|
observableContactsController = [ObservableValueController observableValueControllerWithInitialValue:nil];
|
||||||
observableRedPhoneUsersController = [ObservableValueController observableValueControllerWithInitialValue:nil];
|
|
||||||
[self registerNotificationHandlers];
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -46,12 +41,6 @@ typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL*);
|
||||||
[self setupLatestContacts:latestContacts];
|
[self setupLatestContacts:latestContacts];
|
||||||
}
|
}
|
||||||
} untilCancelled:life.token];
|
} untilCancelled:life.token];
|
||||||
|
|
||||||
[observableRedPhoneUsersController watchLatestValueOnArbitraryThread:^(NSArray *latestUsers) {
|
|
||||||
@synchronized(self) {
|
|
||||||
[self setupLatestRedPhoneUsers:latestUsers];
|
|
||||||
}
|
|
||||||
} untilCancelled:life.token];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)dealloc {
|
-(void)dealloc {
|
||||||
|
@ -64,17 +53,6 @@ typedef BOOL (^ContactSearchBlock)(id, NSUInteger, BOOL*);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Notification Handlers
|
|
||||||
-(void) registerNotificationHandlers{
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatedDirectoryHandler:) name:NOTIFICATION_DIRECTORY_UPDATE object:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) updatedDirectoryHandler:(NSNotification*) notification {
|
|
||||||
NSArray *currentUsers = [self getSignalUsersFromContactsArray:latestContactsById.allValues];
|
|
||||||
|
|
||||||
[observableRedPhoneUsersController updateValue:currentUsers];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Address Book callbacks
|
#pragma mark - Address Book callbacks
|
||||||
|
|
||||||
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context);
|
void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef info, void *context);
|
||||||
|
@ -82,7 +60,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
ContactsManager* contactsManager = (__bridge ContactsManager*)context;
|
ContactsManager* contactsManager = (__bridge ContactsManager*)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];
|
||||||
[[[Environment getCurrent] phoneDirectoryManager] forceUpdate];
|
[contactsManager intersectContacts];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +74,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
ABAddressBookRegisterExternalChangeCallback(cfAddressBook, onAddressBookChanged, (__bridge void*)self);
|
ABAddressBookRegisterExternalChangeCallback(cfAddressBook, onAddressBookChanged, (__bridge void*)self);
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
|
||||||
[self pullLatestAddressBook];
|
[self pullLatestAddressBook];
|
||||||
|
[self intersectContacts];
|
||||||
});
|
});
|
||||||
}];
|
}];
|
||||||
});
|
});
|
||||||
|
@ -116,10 +95,6 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
- (void)setupLatestContacts:(NSArray *)contacts {
|
- (void)setupLatestContacts:(NSArray *)contacts {
|
||||||
if (contacts) {
|
if (contacts) {
|
||||||
latestContactsById = [ContactsManager keyContactsById:contacts];
|
latestContactsById = [ContactsManager keyContactsById:contacts];
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
|
||||||
[self updatedDirectoryHandler:nil];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,10 +158,6 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
return observableContactsController;
|
return observableContactsController;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(ObservableValue *)getObservableRedPhoneUsers {
|
|
||||||
return observableRedPhoneUsersController;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Address Book utils
|
#pragma mark - Address Book utils
|
||||||
|
|
||||||
+(TOCFuture*) asyncGetAddressBook {
|
+(TOCFuture*) asyncGetAddressBook {
|
||||||
|
@ -402,7 +373,7 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*)allContacts {
|
- (NSArray<Contact *> *)allContacts {
|
||||||
NSMutableArray *allContacts = [NSMutableArray array];
|
NSMutableArray *allContacts = [NSMutableArray array];
|
||||||
|
|
||||||
for (NSString *key in latestContactsById.allKeys){
|
for (NSString *key in latestContactsById.allKeys){
|
||||||
|
@ -460,8 +431,8 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
|
|
||||||
-(NSArray*) getSignalUsersFromContactsArray:(NSArray*)contacts {
|
-(NSArray*) getSignalUsersFromContactsArray:(NSArray*)contacts {
|
||||||
return [[contacts filter:^int(Contact* contact) {
|
return [[contacts filter:^int(Contact* contact) {
|
||||||
return [self isContactRegisteredWithRedPhone:contact] || contact.isTextSecureContact;
|
return contact.isRedPhoneContact || contact.isTextSecureContact;
|
||||||
}]sortedArrayUsingComparator:[[self class] contactComparator]];
|
}] sortedArrayUsingComparator:[[self class] contactComparator]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSComparator)contactComparator {
|
+ (NSComparator)contactComparator {
|
||||||
|
@ -497,19 +468,6 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
||||||
return newSet.allObjects;
|
return newSet.allObjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isContactRegisteredWithRedPhone:(Contact*)contact {
|
|
||||||
for(PhoneNumber *phoneNumber in contact.parsedPhoneNumbers){
|
|
||||||
if ( [self isPhoneNumberRegisteredWithRedPhone:phoneNumber]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isPhoneNumberRegisteredWithRedPhone:(PhoneNumber*)phoneNumber {
|
|
||||||
PhoneNumberDirectoryFilter* directory = Environment.getCurrent.phoneDirectoryManager.getCurrentFilter;
|
|
||||||
return phoneNumber != nil && [directory containsPhoneNumber:phoneNumber];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString*)nameStringForPhoneIdentifier:(NSString*)identifier{
|
- (NSString*)nameStringForPhoneIdentifier:(NSString*)identifier{
|
||||||
for (Contact *contact in self.allContacts) {
|
for (Contact *contact in self.allContacts) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#import "EvpMessageDigest.h"
|
#import "EvpMessageDigest.h"
|
||||||
|
|
||||||
#import <evp.h>
|
#import <OpenSSL/evp.h>
|
||||||
#import <hmac.h>
|
#import <OpenSSL/hmac.h>
|
||||||
|
|
||||||
#import "Constraints.h"
|
#import "Constraints.h"
|
||||||
#import "EvpUtil.h"
|
#import "EvpUtil.h"
|
||||||
|
|
|
@ -26,7 +26,6 @@ static NSString* const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
@class RecentCallManager;
|
@class RecentCallManager;
|
||||||
@class ContactsManager;
|
@class ContactsManager;
|
||||||
@class PhoneManager;
|
@class PhoneManager;
|
||||||
@class PhoneNumberDirectoryFilterManager;
|
|
||||||
@class SignalsViewController;
|
@class SignalsViewController;
|
||||||
|
|
||||||
@interface Environment : NSObject
|
@interface Environment : NSObject
|
||||||
|
@ -45,7 +44,6 @@ static NSString* const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
@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) ContactsManager *contactsManager;
|
||||||
@property (nonatomic, readonly) PhoneNumberDirectoryFilterManager* phoneDirectoryManager;
|
|
||||||
|
|
||||||
@property (nonatomic, readonly) SignalsViewController *signalsViewController;
|
@property (nonatomic, readonly) SignalsViewController *signalsViewController;
|
||||||
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
|
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
|
||||||
|
@ -61,15 +59,14 @@ static NSString* const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||||
andDefaultRelayName:(NSString*)defaultRelayName
|
andDefaultRelayName:(NSString*)defaultRelayName
|
||||||
andRelayServerHostNameSuffix:(NSString*)relayServerHostNameSuffix
|
andRelayServerHostNameSuffix:(NSString*)relayServerHostNameSuffix
|
||||||
andCertificate:(Certificate*)certificate
|
andCertificate:(Certificate*)certificate
|
||||||
andCurrentRegionCodeForPhoneNumbers:(NSString*)currentRegionCodeForPhoneNumbers
|
andCurrentRegionCodeForPhoneNumbers:(NSString*)currentRegionCodeForPhoneNumbers
|
||||||
andSupportedKeyAgreementProtocols:(NSArray*)keyAgreementProtocolsInDescendingPriority
|
andSupportedKeyAgreementProtocols:(NSArray*)keyAgreementProtocolsInDescendingPriority
|
||||||
andPhoneManager:(PhoneManager*)phoneManager
|
andPhoneManager:(PhoneManager*)phoneManager
|
||||||
andRecentCallManager:(RecentCallManager *)recentCallManager
|
andRecentCallManager:(RecentCallManager *)recentCallManager
|
||||||
andTestingAndLegacyOptions:(NSArray*)testingAndLegacyOptions
|
andTestingAndLegacyOptions:(NSArray*)testingAndLegacyOptions
|
||||||
andZrtpClientId:(NSData*)zrtpClientId
|
andZrtpClientId:(NSData*)zrtpClientId
|
||||||
andZrtpVersionId:(NSData*)zrtpVersionId
|
andZrtpVersionId:(NSData*)zrtpVersionId
|
||||||
andContactsManager:(ContactsManager *)contactsManager
|
andContactsManager:(ContactsManager *)contactsManager;
|
||||||
andPhoneDirectoryManager:(PhoneNumberDirectoryFilterManager*)phoneDirectoryManager;
|
|
||||||
|
|
||||||
+(Environment*) getCurrent;
|
+(Environment*) getCurrent;
|
||||||
+(void) setCurrent:(Environment*)curEnvironment;
|
+(void) setCurrent:(Environment*)curEnvironment;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#import "DH3KKeyAgreementProtocol.h"
|
#import "DH3KKeyAgreementProtocol.h"
|
||||||
#import "RecentCallManager.h"
|
#import "RecentCallManager.h"
|
||||||
#import "MessagesViewController.h"
|
#import "MessagesViewController.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
#import "SignalKeyingStorage.h"
|
#import "SignalKeyingStorage.h"
|
||||||
#import "SignalsViewController.h"
|
#import "SignalsViewController.h"
|
||||||
#import "TSContactThread.h"
|
#import "TSContactThread.h"
|
||||||
|
@ -32,8 +31,7 @@ zrtpClientId,
|
||||||
zrtpVersionId,
|
zrtpVersionId,
|
||||||
phoneManager,
|
phoneManager,
|
||||||
recentCallManager,
|
recentCallManager,
|
||||||
contactsManager,
|
contactsManager;
|
||||||
phoneDirectoryManager;
|
|
||||||
|
|
||||||
+(NSString*) currentRegionCodeForPhoneNumbers {
|
+(NSString*) currentRegionCodeForPhoneNumbers {
|
||||||
return self.getCurrent.currentRegionCodeForPhoneNumbers;
|
return self.getCurrent.currentRegionCodeForPhoneNumbers;
|
||||||
|
@ -88,8 +86,7 @@ phoneDirectoryManager;
|
||||||
andTestingAndLegacyOptions:(NSArray*)testingAndLegacyOptions
|
andTestingAndLegacyOptions:(NSArray*)testingAndLegacyOptions
|
||||||
andZrtpClientId:(NSData*)zrtpClientId
|
andZrtpClientId:(NSData*)zrtpClientId
|
||||||
andZrtpVersionId:(NSData*)zrtpVersionId
|
andZrtpVersionId:(NSData*)zrtpVersionId
|
||||||
andContactsManager:(ContactsManager *)contactsManager
|
andContactsManager:(ContactsManager *)contactsManager {
|
||||||
andPhoneDirectoryManager:(PhoneNumberDirectoryFilterManager*)phoneDirectoryManager {
|
|
||||||
|
|
||||||
require(errorNoter != nil);
|
require(errorNoter != nil);
|
||||||
require(zrtpClientId != nil);
|
require(zrtpClientId != nil);
|
||||||
|
@ -114,7 +111,6 @@ phoneDirectoryManager;
|
||||||
e->masterServerSecureEndPoint = [SecureEndPoint secureEndPointForHost:[HostNameEndPoint hostNameEndPointWithHostName:masterServerHostName
|
e->masterServerSecureEndPoint = [SecureEndPoint secureEndPointForHost:[HostNameEndPoint hostNameEndPointWithHostName:masterServerHostName
|
||||||
andPort:serverPort]
|
andPort:serverPort]
|
||||||
identifiedByCertificate:certificate];
|
identifiedByCertificate:certificate];
|
||||||
e->phoneDirectoryManager = phoneDirectoryManager;
|
|
||||||
e->defaultRelayName = defaultRelayName;
|
e->defaultRelayName = defaultRelayName;
|
||||||
e->certificate = certificate;
|
e->certificate = certificate;
|
||||||
e->relayServerHostNameSuffix = relayServerHostNameSuffix;
|
e->relayServerHostNameSuffix = relayServerHostNameSuffix;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "PhoneNumberDirectoryFilter.h"
|
|
||||||
#import "PropertyListPreferences.h"
|
#import "PropertyListPreferences.h"
|
||||||
#import "Zid.h"
|
#import "Zid.h"
|
||||||
|
|
||||||
|
@ -20,8 +19,6 @@ typedef NS_ENUM(NSUInteger, TSImageQuality) {
|
||||||
|
|
||||||
@interface PropertyListPreferences (PropertyUtil)
|
@interface PropertyListPreferences (PropertyUtil)
|
||||||
|
|
||||||
- (PhoneNumberDirectoryFilter*) tryGetSavedPhoneNumberDirectory;
|
|
||||||
- (void) setSavedPhoneNumberDirectory:(PhoneNumberDirectoryFilter*)phoneNumberDirectoryFilter;
|
|
||||||
- (NSTimeInterval) getCachedOrDefaultDesiredBufferDepth;
|
- (NSTimeInterval) getCachedOrDefaultDesiredBufferDepth;
|
||||||
- (void) setCachedDesiredBufferDepth:(double)value;
|
- (void) setCachedDesiredBufferDepth:(double)value;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
#import "PreferencesUtil.h"
|
#import "PreferencesUtil.h"
|
||||||
#import "Constraints.h"
|
#import "Constraints.h"
|
||||||
|
|
||||||
#import "NotificationManifest.h"
|
|
||||||
|
|
||||||
#define CALL_STREAM_DES_BUFFER_LEVEL_KEY @"CallStreamDesiredBufferLevel"
|
#define CALL_STREAM_DES_BUFFER_LEVEL_KEY @"CallStreamDesiredBufferLevel"
|
||||||
|
|
||||||
#define PHONE_DIRECTORY_BLOOM_FILTER_HASH_COUNT_KEY @"Directory Bloom Hash Count"
|
|
||||||
#define PHONE_DIRECTORY_EXPIRATION @"Directory Expiration"
|
|
||||||
|
|
||||||
#define DEFAULT_CALL_STREAM_DES_BUFFER_LEVEL 0.5
|
#define DEFAULT_CALL_STREAM_DES_BUFFER_LEVEL 0.5
|
||||||
|
|
||||||
|
@ -27,38 +23,8 @@
|
||||||
#define PLAY_SOUND_IN_FOREGROUND_KEY @"NotificationSoundInForeground"
|
#define PLAY_SOUND_IN_FOREGROUND_KEY @"NotificationSoundInForeground"
|
||||||
#define HAS_REGISTERED_VOIP_PUSH @"VOIPPushEnabled"
|
#define HAS_REGISTERED_VOIP_PUSH @"VOIPPushEnabled"
|
||||||
|
|
||||||
#define BloomFilterCacheName @"bloomfilter"
|
|
||||||
|
|
||||||
@implementation PropertyListPreferences (PropertyUtil)
|
@implementation PropertyListPreferences (PropertyUtil)
|
||||||
|
|
||||||
-(PhoneNumberDirectoryFilter*) tryGetSavedPhoneNumberDirectory {
|
|
||||||
NSUInteger hashCount = [[self tryGetValueForKey:PHONE_DIRECTORY_BLOOM_FILTER_HASH_COUNT_KEY] unsignedIntegerValue];
|
|
||||||
NSData* data = [self tryRetreiveBloomFilter];
|
|
||||||
NSDate* expiration = [self tryGetValueForKey:PHONE_DIRECTORY_EXPIRATION];
|
|
||||||
if (hashCount == 0 || data.length == 0 || expiration == nil) return nil;
|
|
||||||
BloomFilter* bloomFilter = [BloomFilter bloomFilterWithHashCount:hashCount andData:data];
|
|
||||||
return [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:bloomFilter
|
|
||||||
andExpirationDate:expiration];
|
|
||||||
}
|
|
||||||
-(void) setSavedPhoneNumberDirectory:(PhoneNumberDirectoryFilter*)phoneNumberDirectoryFilter {
|
|
||||||
[self storeBloomfilter:nil];
|
|
||||||
[self setValueForKey:PHONE_DIRECTORY_BLOOM_FILTER_HASH_COUNT_KEY toValue:nil];
|
|
||||||
[self setValueForKey:PHONE_DIRECTORY_EXPIRATION toValue:nil];
|
|
||||||
if (phoneNumberDirectoryFilter == nil) return;
|
|
||||||
|
|
||||||
NSData* data = [[phoneNumberDirectoryFilter bloomFilter] data];
|
|
||||||
NSNumber* hashCount = @([[phoneNumberDirectoryFilter bloomFilter] hashCount]);
|
|
||||||
NSDate* expiry = phoneNumberDirectoryFilter.getExpirationDate;
|
|
||||||
[self storeBloomfilter:data];
|
|
||||||
[self setValueForKey:PHONE_DIRECTORY_BLOOM_FILTER_HASH_COUNT_KEY toValue:hashCount];
|
|
||||||
[self setValueForKey:PHONE_DIRECTORY_EXPIRATION toValue:expiry];
|
|
||||||
[self sendDirectoryUpdateNotification];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) sendDirectoryUpdateNotification{
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_UPDATE object:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(NSTimeInterval) getCachedOrDefaultDesiredBufferDepth {
|
-(NSTimeInterval) getCachedOrDefaultDesiredBufferDepth {
|
||||||
id v = [self tryGetValueForKey:CALL_STREAM_DES_BUFFER_LEVEL_KEY];
|
id v = [self tryGetValueForKey:CALL_STREAM_DES_BUFFER_LEVEL_KEY];
|
||||||
if (v == nil) return DEFAULT_CALL_STREAM_DES_BUFFER_LEVEL;
|
if (v == nil) return DEFAULT_CALL_STREAM_DES_BUFFER_LEVEL;
|
||||||
|
@ -255,52 +221,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Bloom filter
|
|
||||||
|
|
||||||
- (NSData*)tryRetreiveBloomFilter {
|
|
||||||
return [NSData dataWithContentsOfFile:[self bloomfilterPath]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)storeBloomfilter:(NSData*)bloomFilterData {
|
|
||||||
if (!bloomFilterData) {
|
|
||||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
||||||
NSError *error;
|
|
||||||
|
|
||||||
if ([fileManager fileExistsAtPath:[self bloomfilterPath]]) {
|
|
||||||
[fileManager removeItemAtPath:[self bloomfilterPath] error:&error];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
DDLogError(@"Failed to remove bloomfilter with error: %@", error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSError *error;
|
|
||||||
[bloomFilterData writeToFile:[self bloomfilterPath] options:NSDataWritingAtomic error:&error];
|
|
||||||
if (error) {
|
|
||||||
DDLogError(@"Failed to store bloomfilter with error: %@", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString*)bloomfilterPath {
|
|
||||||
NSFileManager *fm = [NSFileManager defaultManager];
|
|
||||||
NSArray *cachesDir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
||||||
NSString *bloomFilterPath = [cachesDir objectAtIndex:0];
|
|
||||||
NSError *error;
|
|
||||||
|
|
||||||
if (![fm fileExistsAtPath:bloomFilterPath]) {
|
|
||||||
[fm createDirectoryAtPath:bloomFilterPath withIntermediateDirectories:YES attributes:@{} error:&error];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
DDLogError(@"Failed to create caches directory with error: %@", error.description);
|
|
||||||
}
|
|
||||||
|
|
||||||
bloomFilterPath = [bloomFilterPath stringByAppendingPathComponent:BloomFilterCacheName];
|
|
||||||
|
|
||||||
return bloomFilterPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#import "PhoneManager.h"
|
#import "PhoneManager.h"
|
||||||
#import "PhoneNumberUtil.h"
|
#import "PhoneNumberUtil.h"
|
||||||
#import "RecentCallManager.h"
|
#import "RecentCallManager.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
|
|
||||||
#define RELEASE_ZRTP_CLIENT_ID @"Whisper 000 ".encodedAsAscii
|
#define RELEASE_ZRTP_CLIENT_ID @"Whisper 000 ".encodedAsAscii
|
||||||
#define RELEASE_ZRTP_VERSION_ID @"1.10".encodedAsAscii
|
#define RELEASE_ZRTP_VERSION_ID @"1.10".encodedAsAscii
|
||||||
|
@ -75,8 +74,7 @@ static unsigned char DH3K_PRIME[]={
|
||||||
andTestingAndLegacyOptions:@[ENVIRONMENT_LEGACY_OPTION_RTP_PADDING_BIT_IMPLIES_EXTENSION_BIT_AND_TWELVE_EXTRA_ZERO_BYTES_IN_HEADER]
|
andTestingAndLegacyOptions:@[ENVIRONMENT_LEGACY_OPTION_RTP_PADDING_BIT_IMPLIES_EXTENSION_BIT_AND_TWELVE_EXTRA_ZERO_BYTES_IN_HEADER]
|
||||||
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
||||||
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
||||||
andContactsManager:[ContactsManager new]
|
andContactsManager:[ContactsManager new]];
|
||||||
andPhoneDirectoryManager:[PhoneNumberDirectoryFilterManager new]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+(Environment*) stagingEnvironmentWithLogging:(id<Logging>)logging {
|
+(Environment*) stagingEnvironmentWithLogging:(id<Logging>)logging {
|
||||||
|
@ -110,8 +108,7 @@ static unsigned char DH3K_PRIME[]={
|
||||||
andTestingAndLegacyOptions:@[ENVIRONMENT_LEGACY_OPTION_RTP_PADDING_BIT_IMPLIES_EXTENSION_BIT_AND_TWELVE_EXTRA_ZERO_BYTES_IN_HEADER]
|
andTestingAndLegacyOptions:@[ENVIRONMENT_LEGACY_OPTION_RTP_PADDING_BIT_IMPLIES_EXTENSION_BIT_AND_TWELVE_EXTRA_ZERO_BYTES_IN_HEADER]
|
||||||
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
andZrtpClientId:RELEASE_ZRTP_CLIENT_ID
|
||||||
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
andZrtpVersionId:RELEASE_ZRTP_VERSION_ID
|
||||||
andContactsManager:[ContactsManager new]
|
andContactsManager:[ContactsManager new]];
|
||||||
andPhoneDirectoryManager:[PhoneNumberDirectoryFilterManager new]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+(Environment*) unitTestEnvironment:(NSArray*)testingAndLegacyOptions {
|
+(Environment*) unitTestEnvironment:(NSArray*)testingAndLegacyOptions {
|
||||||
|
@ -134,8 +131,7 @@ static unsigned char DH3K_PRIME[]={
|
||||||
andTestingAndLegacyOptions:testingAndLegacyOptions
|
andTestingAndLegacyOptions:testingAndLegacyOptions
|
||||||
andZrtpClientId:TESTING_ZRTP_CLIENT_ID
|
andZrtpClientId:TESTING_ZRTP_CLIENT_ID
|
||||||
andZrtpVersionId:TESTING_ZRTP_VERSION_ID
|
andZrtpVersionId:TESTING_ZRTP_VERSION_ID
|
||||||
andContactsManager:nil
|
andContactsManager:nil];
|
||||||
andPhoneDirectoryManager:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+(NSArray*) supportedKeyAgreementProtocols {
|
+(NSArray*) supportedKeyAgreementProtocols {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "LockInteractionController.h"
|
#import "LockInteractionController.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
#import "PreferencesUtil.h"
|
#import "PreferencesUtil.h"
|
||||||
#import "PushManager.h"
|
#import "PushManager.h"
|
||||||
#import "TSAccountManager.h"
|
#import "TSAccountManager.h"
|
||||||
|
@ -58,6 +57,16 @@
|
||||||
[self clearVideoCache];
|
[self clearVideoCache];
|
||||||
[self blockingAttributesUpdate];
|
[self blockingAttributesUpdate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.3.0"] && [TSAccountManager isRegistered]) {
|
||||||
|
NSFileManager *fm = [NSFileManager defaultManager];
|
||||||
|
NSArray *cachesDir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||||
|
NSString *bloomFilterPath = [[cachesDir objectAtIndex:0] stringByAppendingPathComponent:@"bloomfilter"];
|
||||||
|
[fm removeItemAtPath:bloomFilterPath error:nil];
|
||||||
|
[[TSStorageManager sharedManager].dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction * _Nonnull transaction) {
|
||||||
|
[transaction removeAllObjectsInCollection:@"TSRecipient"];
|
||||||
|
}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL) isVersion:(NSString *)thisVersionString atLeast:(NSString *)openLowerBoundVersionString andLessThan:(NSString *)closedUpperBoundVersionString {
|
+ (BOOL) isVersion:(NSString *)thisVersionString atLeast:(NSString *)openLowerBoundVersionString andLessThan:(NSString *)closedUpperBoundVersionString {
|
||||||
|
|
|
@ -37,7 +37,6 @@ typedef NS_ENUM(NSInteger, HTTPMethod) {
|
||||||
+ (RPAPICall*)registerPushNotificationWithPushToken:(NSData*)pushToken voipToken:(NSData*)voipToken;
|
+ (RPAPICall*)registerPushNotificationWithPushToken:(NSData*)pushToken voipToken:(NSData*)voipToken;
|
||||||
+ (RPAPICall*)requestTextSecureVerificationCode;
|
+ (RPAPICall*)requestTextSecureVerificationCode;
|
||||||
+ (RPAPICall*)unregisterWithPushToken:(NSData*)pushToken;
|
+ (RPAPICall*)unregisterWithPushToken:(NSData*)pushToken;
|
||||||
+ (RPAPICall*)fetchBloomFilter;
|
|
||||||
|
|
||||||
//+ (RPAPICall*)requestToOpenPortWithSessionId:(int64_t)sessionId;
|
//+ (RPAPICall*)requestToOpenPortWithSessionId:(int64_t)sessionId;
|
||||||
//+ (RPAPICall*)requestToRingWithSessionId:(int64_t)sessionId;
|
//+ (RPAPICall*)requestToRingWithSessionId:(int64_t)sessionId;
|
||||||
|
|
|
@ -83,14 +83,6 @@
|
||||||
return apiCall;
|
return apiCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (RPAPICall*)fetchBloomFilter {
|
|
||||||
RPAPICall *apiCall = [self defaultAPICall];
|
|
||||||
apiCall.method = HTTP_GET;
|
|
||||||
apiCall.endPoint = @"/users/directory";
|
|
||||||
apiCall.requestSerializer = [self basicAuthenticationSerializer];
|
|
||||||
return apiCall;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (RPAPICall*)unregisterWithPushToken:(NSData*)pushToken {
|
+ (RPAPICall*)unregisterWithPushToken:(NSData*)pushToken {
|
||||||
RPAPICall *apiCall = [self defaultAPICall];
|
RPAPICall *apiCall = [self defaultAPICall];
|
||||||
apiCall.method = HTTP_DELETE;
|
apiCall.method = HTTP_DELETE;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
|
||||||
#import "ProtocolBuffers.h"
|
#import <ProtocolBuffers/ProtocolBuffers.h>
|
||||||
|
|
||||||
// @@protoc_insertion_point(imports)
|
// @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "HttpManager.h"
|
#import "HttpManager.h"
|
||||||
#import "HttpRequestUtil.h"
|
#import "HttpRequestUtil.h"
|
||||||
#import "PhoneNumberDirectoryFilter.h"
|
|
||||||
|
|
||||||
#define SIGNAL_STATUS_CODE_STALE_SESSION 404
|
#define SIGNAL_STATUS_CODE_STALE_SESSION 404
|
||||||
#define SIGNAL_STATUS_CODE_NO_SUCH_USER 404
|
#define SIGNAL_STATUS_CODE_NO_SUCH_USER 404
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import "BloomFilter.h"
|
|
||||||
#import "PhoneNumber.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* PhoneNumberDirectoryFilter matches numbers-to-be-called against a bloom filter that determines if those numbers are red phone compatible.
|
|
||||||
* The bloom filter expires periodically, and must be updated from the whispersystem servers.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@interface PhoneNumberDirectoryFilter : NSObject {
|
|
||||||
@private NSDate* expirationDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (nonatomic,readonly) BloomFilter* bloomFilter;
|
|
||||||
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterDefault;
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterWithBloomFilter:(BloomFilter*)bloomFilter
|
|
||||||
andExpirationDate:(NSDate*)expirationDate;
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)response body:(NSData*)data;
|
|
||||||
|
|
||||||
-(bool) containsPhoneNumber:(PhoneNumber*)phoneNumber;
|
|
||||||
-(NSDate*) getExpirationDate;
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,63 +0,0 @@
|
||||||
#import "PhoneNumberDirectoryFilter.h"
|
|
||||||
#import "Constraints.h"
|
|
||||||
|
|
||||||
#define HASH_COUNT_HEADER_KEY @"X-Hash-Count"
|
|
||||||
#define MIN_NEW_EXPIRATION_SECONDS (12 * 60 * 60)
|
|
||||||
#define MAX_EXPIRATION_SECONDS (24 * 60 * 60)
|
|
||||||
|
|
||||||
@implementation PhoneNumberDirectoryFilter
|
|
||||||
|
|
||||||
@synthesize bloomFilter;
|
|
||||||
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterDefault {
|
|
||||||
return [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:[BloomFilter bloomFilterWithNothing]
|
|
||||||
andExpirationDate:[NSDate date]];
|
|
||||||
}
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterWithBloomFilter:(BloomFilter*)bloomFilter
|
|
||||||
andExpirationDate:(NSDate*)expirationDate {
|
|
||||||
require(bloomFilter != nil);
|
|
||||||
require(expirationDate != nil);
|
|
||||||
PhoneNumberDirectoryFilter* newInstance = [PhoneNumberDirectoryFilter new];
|
|
||||||
newInstance->bloomFilter = bloomFilter;
|
|
||||||
newInstance->expirationDate = expirationDate;
|
|
||||||
return newInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
-(NSDate*) getExpirationDate {
|
|
||||||
NSDate* currentDate = [NSDate date];
|
|
||||||
NSDate* maxExpiryDate = [NSDate dateWithTimeInterval:MAX_EXPIRATION_SECONDS sinceDate:currentDate];
|
|
||||||
expirationDate = [expirationDate earlierDate:maxExpiryDate];
|
|
||||||
return expirationDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)response body:(NSData*)data {
|
|
||||||
require(response != nil);
|
|
||||||
|
|
||||||
checkOperation(response.statusCode == 200);
|
|
||||||
|
|
||||||
NSString* hashCountHeader = response.allHeaderFields[HASH_COUNT_HEADER_KEY];
|
|
||||||
checkOperation(hashCountHeader != nil);
|
|
||||||
|
|
||||||
int hashCountValue = hashCountHeader.intValue;
|
|
||||||
checkOperation(hashCountValue > 0);
|
|
||||||
|
|
||||||
NSData* responseBody = data;
|
|
||||||
checkOperation(responseBody.length > 0);
|
|
||||||
|
|
||||||
BloomFilter* bloomFilter = [BloomFilter bloomFilterWithHashCount:(NSUInteger)hashCountValue
|
|
||||||
andData:responseBody];
|
|
||||||
|
|
||||||
NSTimeInterval expirationDuration = MIN_NEW_EXPIRATION_SECONDS
|
|
||||||
+ arc4random_uniform(MAX_EXPIRATION_SECONDS - MIN_NEW_EXPIRATION_SECONDS);
|
|
||||||
NSDate* expirationDate = [NSDate dateWithTimeInterval:expirationDuration sinceDate:[NSDate date]];
|
|
||||||
|
|
||||||
return [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:bloomFilter
|
|
||||||
andExpirationDate:expirationDate];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(bool) containsPhoneNumber:(PhoneNumber*)phoneNumber {
|
|
||||||
if (phoneNumber == nil) return false;
|
|
||||||
return [bloomFilter contains:phoneNumber.toE164];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,22 +0,0 @@
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import "CollapsingFutures.h"
|
|
||||||
#import "PhoneNumberDirectoryFilter.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* PhoneNumberDirectoryFilterManager is responsible for periodically downloading the latest
|
|
||||||
* bloom filter containing phone numbers considered to have RedPhone support.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@interface PhoneNumberDirectoryFilterManager : NSObject {
|
|
||||||
@private PhoneNumberDirectoryFilter* phoneNumberDirectoryFilter;
|
|
||||||
@private TOCCancelToken* lifetimeToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) forceUpdate;
|
|
||||||
-(void) startUntilCancelled:(TOCCancelToken*)cancelToken;
|
|
||||||
-(PhoneNumberDirectoryFilter*) getCurrentFilter;
|
|
||||||
|
|
||||||
@property BOOL isRefreshing;
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,158 +0,0 @@
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
|
|
||||||
#import "ContactsManager.h"
|
|
||||||
#import "Cryptography.h"
|
|
||||||
#import "Environment.h"
|
|
||||||
#import "NotificationManifest.h"
|
|
||||||
#import "PreferencesUtil.h"
|
|
||||||
#import "RPServerRequestsManager.h"
|
|
||||||
#import "ThreadManager.h"
|
|
||||||
#import "TSNetworkManager.h"
|
|
||||||
#import "TSRecipient.h"
|
|
||||||
#import "Util.h"
|
|
||||||
|
|
||||||
#define MINUTE (60.0)
|
|
||||||
#define HOUR (MINUTE*60.0)
|
|
||||||
|
|
||||||
#define DIRECTORY_UPDATE_TIMEOUT_PERIOD (1.0*MINUTE)
|
|
||||||
#define DIRECTORY_UPDATE_RETRY_PERIOD (1.0*HOUR)
|
|
||||||
|
|
||||||
@implementation PhoneNumberDirectoryFilterManager {
|
|
||||||
@private TOCCancelTokenSource* currentUpdateLifetime;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)init {
|
|
||||||
if (self = [super init]) {
|
|
||||||
phoneNumberDirectoryFilter = PhoneNumberDirectoryFilter.phoneNumberDirectoryFilterDefault;
|
|
||||||
_isRefreshing = NO;
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
- (void)startUntilCancelled:(TOCCancelToken*)cancelToken {
|
|
||||||
lifetimeToken = cancelToken;
|
|
||||||
|
|
||||||
phoneNumberDirectoryFilter = [Environment.preferences tryGetSavedPhoneNumberDirectory];
|
|
||||||
if (phoneNumberDirectoryFilter == nil) {
|
|
||||||
phoneNumberDirectoryFilter = PhoneNumberDirectoryFilter.phoneNumberDirectoryFilterDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
[self scheduleUpdate];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (PhoneNumberDirectoryFilter*)getCurrentFilter {
|
|
||||||
@synchronized(self) {
|
|
||||||
return phoneNumberDirectoryFilter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- (void)forceUpdate {
|
|
||||||
[self scheduleUpdateAt:NSDate.date];
|
|
||||||
}
|
|
||||||
- (void)scheduleUpdate {
|
|
||||||
return [self scheduleUpdateAt:self.getCurrentFilter.getExpirationDate];
|
|
||||||
}
|
|
||||||
- (void)scheduleUpdateAt:(NSDate*)date {
|
|
||||||
void(^doUpdate)(void) = ^{
|
|
||||||
if (Environment.isRedPhoneRegistered) {
|
|
||||||
[self updateRedPhone];
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
[currentUpdateLifetime cancel];
|
|
||||||
currentUpdateLifetime = [TOCCancelTokenSource new];
|
|
||||||
[lifetimeToken whenCancelledDo:^{ [currentUpdateLifetime cancel]; }];
|
|
||||||
[TimeUtil scheduleRun:doUpdate
|
|
||||||
at:date
|
|
||||||
onRunLoop:[ThreadManager normalLatencyThreadRunLoop]
|
|
||||||
unlessCancelled:currentUpdateLifetime.token];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (void) updateRedPhone {
|
|
||||||
_isRefreshing = YES;
|
|
||||||
[[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall fetchBloomFilter] success:^(NSURLSessionDataTask *task, id responseObject) {
|
|
||||||
PhoneNumberDirectoryFilter *directory = [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)task.response body:responseObject];
|
|
||||||
|
|
||||||
@synchronized(self) {
|
|
||||||
phoneNumberDirectoryFilter = directory;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Environment.preferences setSavedPhoneNumberDirectory:directory];
|
|
||||||
[self updateTextSecureWithRedPhoneSucces:YES];
|
|
||||||
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
|
||||||
DDLogError(@"Error to fetch contact interesection: %@", error.debugDescription);
|
|
||||||
NSString* desc = [NSString stringWithFormat:NSLocalizedString(@"FAILED_RETRYING_DIRECTORY_DOWNLOAD", @""),
|
|
||||||
DIRECTORY_UPDATE_RETRY_PERIOD/HOUR];
|
|
||||||
Environment.errorNoter(desc, error, false);
|
|
||||||
BloomFilter* filter = [phoneNumberDirectoryFilter bloomFilter];
|
|
||||||
NSDate* retryDate = [NSDate dateWithTimeInterval:DIRECTORY_UPDATE_RETRY_PERIOD
|
|
||||||
sinceDate:[NSDate date]];
|
|
||||||
@synchronized(self) {
|
|
||||||
phoneNumberDirectoryFilter = [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:filter
|
|
||||||
andExpirationDate:retryDate];
|
|
||||||
}
|
|
||||||
|
|
||||||
[self updateTextSecureWithRedPhoneSucces:NO];
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)updateTextSecureWithRedPhoneSucces:(BOOL)redPhoneSuccess {
|
|
||||||
NSArray *allContacts = [[[Environment getCurrent] contactsManager] allContacts];
|
|
||||||
|
|
||||||
NSMutableDictionary *contactsByPhoneNumber = [NSMutableDictionary dictionary];
|
|
||||||
NSMutableDictionary *phoneNumbersByHashes = [NSMutableDictionary dictionary];
|
|
||||||
|
|
||||||
for (Contact *contact in allContacts) {
|
|
||||||
for (PhoneNumber *phoneNumber in contact.parsedPhoneNumbers) {
|
|
||||||
[phoneNumbersByHashes setObject:phoneNumber.toE164 forKey:[Cryptography truncatedSHA1Base64EncodedWithoutPadding:phoneNumber.toE164]];
|
|
||||||
[contactsByPhoneNumber setObject:contact forKey:phoneNumber.toE164];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NSArray *hashes = [phoneNumbersByHashes allKeys];
|
|
||||||
|
|
||||||
TSRequest *request = [[TSContactsIntersectionRequest alloc]initWithHashesArray:hashes];
|
|
||||||
|
|
||||||
[[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *tsTask, id responseDict) {
|
|
||||||
NSMutableArray *tsIdentifiers = [NSMutableArray array];
|
|
||||||
NSMutableDictionary *relayForIdentifier = [NSMutableDictionary dictionary];
|
|
||||||
NSArray *contactsArray = [(NSDictionary*)responseDict objectForKey:@"contacts"];
|
|
||||||
|
|
||||||
if (contactsArray) {
|
|
||||||
for (NSDictionary *dict in contactsArray) {
|
|
||||||
NSString *hash = [dict objectForKey:@"token"];
|
|
||||||
|
|
||||||
if (hash) {
|
|
||||||
[tsIdentifiers addObject:[phoneNumbersByHashes objectForKey:hash]];
|
|
||||||
|
|
||||||
NSString *relay = [dict objectForKey:@"relay"];
|
|
||||||
if (relay) {
|
|
||||||
[relayForIdentifier setObject:relay forKey:[phoneNumbersByHashes objectForKey:hash]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[[TSStorageManager sharedManager].dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
||||||
for (NSString *identifier in tsIdentifiers) {
|
|
||||||
TSRecipient *recipient = [TSRecipient recipientWithTextSecureIdentifier:identifier withTransaction:transaction];
|
|
||||||
if (!recipient) {
|
|
||||||
NSString *relay = [relayForIdentifier objectForKey:recipient];
|
|
||||||
recipient = [[TSRecipient alloc] initWithTextSecureIdentifier:identifier relay:relay];
|
|
||||||
}
|
|
||||||
[recipient saveWithTransaction:transaction];
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
|
|
||||||
_isRefreshing = NO;
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil];
|
|
||||||
|
|
||||||
[self scheduleUpdate];
|
|
||||||
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
|
||||||
_isRefreshing = NO;
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_FAILED object:nil];
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
28
Signal/src/textsecure/Contacts/SignalRecipient.h
Normal file
28
Signal/src/textsecure/Contacts/SignalRecipient.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
//
|
||||||
|
// TSRecipient.h
|
||||||
|
// TextSecureKit
|
||||||
|
//
|
||||||
|
// Created by Frederic Jacobs on 17/11/14.
|
||||||
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TSYapDatabaseObject.h"
|
||||||
|
|
||||||
|
@interface SignalRecipient : TSYapDatabaseObject
|
||||||
|
|
||||||
|
- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier
|
||||||
|
relay:(NSString *)relay
|
||||||
|
supportsVoice:(BOOL)voiceCapable;
|
||||||
|
|
||||||
|
+ (instancetype)recipientWithTextSecureIdentifier:(NSString*)textSecureIdentifier
|
||||||
|
withTransaction:(YapDatabaseReadTransaction*)transaction;
|
||||||
|
|
||||||
|
- (void)addDevices:(NSSet *)set;
|
||||||
|
|
||||||
|
- (void)removeDevices:(NSSet *)set;
|
||||||
|
|
||||||
|
@property (nonatomic) NSString *relay;
|
||||||
|
@property (nonatomic, retain) NSMutableOrderedSet *devices;
|
||||||
|
@property BOOL supportsVoice;
|
||||||
|
|
||||||
|
@end
|
|
@ -7,20 +7,24 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "TSStorageManager+IdentityKeyStore.h"
|
#import "TSStorageManager+IdentityKeyStore.h"
|
||||||
#import "TSRecipient.h"
|
#import "SignalRecipient.h"
|
||||||
|
|
||||||
@implementation TSRecipient
|
@implementation SignalRecipient
|
||||||
|
|
||||||
+ (NSString*)collection{
|
+ (NSString*)collection{
|
||||||
return @"TSRecipient";
|
return @"SignalRecipient";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier relay:(NSString *)relay{
|
- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier
|
||||||
|
relay:(NSString *)relay
|
||||||
|
supportsVoice:(BOOL)voiceCapable
|
||||||
|
{
|
||||||
self = [super initWithUniqueId:textSecureIdentifier];
|
self = [super initWithUniqueId:textSecureIdentifier];
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
_devices = [NSMutableOrderedSet orderedSetWithObject:[NSNumber numberWithInt:1]];
|
_devices = [NSMutableOrderedSet orderedSetWithObject:[NSNumber numberWithInt:1]];
|
||||||
_relay = relay;
|
_relay = relay;
|
||||||
|
_supportsVoice = voiceCapable;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
|
@ -1,24 +0,0 @@
|
||||||
//
|
|
||||||
// TSRecipient.h
|
|
||||||
// TextSecureKit
|
|
||||||
//
|
|
||||||
// Created by Frederic Jacobs on 17/11/14.
|
|
||||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "TSYapDatabaseObject.h"
|
|
||||||
|
|
||||||
@interface TSRecipient : TSYapDatabaseObject
|
|
||||||
|
|
||||||
- (instancetype)initWithTextSecureIdentifier:(NSString*)textSecureIdentifier relay:(NSString*)relay;
|
|
||||||
|
|
||||||
+ (instancetype)recipientWithTextSecureIdentifier:(NSString*)textSecureIdentifier withTransaction:(YapDatabaseReadTransaction*)transaction;
|
|
||||||
|
|
||||||
- (void)addDevices:(NSSet *)set;
|
|
||||||
|
|
||||||
- (void)removeDevices:(NSSet *)set;
|
|
||||||
|
|
||||||
@property (nonatomic, readonly) NSString *relay;
|
|
||||||
@property (nonatomic, retain) NSMutableOrderedSet *devices;
|
|
||||||
|
|
||||||
@end
|
|
|
@ -9,7 +9,7 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#import "TSThread.h"
|
#import "TSThread.h"
|
||||||
#import "TSRecipient.h"
|
#import "SignalRecipient.h"
|
||||||
|
|
||||||
@class IncomingPushMessageSignal;
|
@class IncomingPushMessageSignal;
|
||||||
|
|
||||||
|
@ -19,6 +19,5 @@
|
||||||
+ (instancetype)getOrCreateThreadWithContactId:(NSString*)contactId transaction:(YapDatabaseReadWriteTransaction*)transaction pushSignal:(IncomingPushMessageSignal*)pushSignal;
|
+ (instancetype)getOrCreateThreadWithContactId:(NSString*)contactId transaction:(YapDatabaseReadWriteTransaction*)transaction pushSignal:(IncomingPushMessageSignal*)pushSignal;
|
||||||
|
|
||||||
- (NSString*)contactIdentifier;
|
- (NSString*)contactIdentifier;
|
||||||
- (TSRecipient *)recipientWithTransaction:(YapDatabaseReadTransaction*)transaction;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "IncomingPushMessageSignal.pb.h"
|
#import "IncomingPushMessageSignal.pb.h"
|
||||||
#import "ContactsManager.h"
|
#import "ContactsManager+updater.h"
|
||||||
|
|
||||||
#define TSContactThreadPrefix @"c"
|
#define TSContactThreadPrefix @"c"
|
||||||
|
|
||||||
|
@ -26,11 +26,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)getOrCreateThreadWithContactId:(NSString*)contactId transaction:(YapDatabaseReadWriteTransaction*)transaction pushSignal:(IncomingPushMessageSignal*)pushSignal{
|
+ (instancetype)getOrCreateThreadWithContactId:(NSString*)contactId transaction:(YapDatabaseReadWriteTransaction*)transaction pushSignal:(IncomingPushMessageSignal*)pushSignal{
|
||||||
TSRecipient *recipient = [TSRecipient recipientWithTextSecureIdentifier:contactId withTransaction:transaction];
|
SignalRecipient *recipient = [SignalRecipient recipientWithTextSecureIdentifier:contactId withTransaction:transaction];
|
||||||
|
|
||||||
if (!recipient) {
|
if (!recipient) {
|
||||||
NSString *relay = pushSignal.hasRelay && ![pushSignal.relay isEqualToString:@""]?pushSignal.relay:nil;
|
NSString *relay = pushSignal.hasRelay && ![pushSignal.relay isEqualToString:@""]?pushSignal.relay:nil;
|
||||||
recipient = [[TSRecipient alloc] initWithTextSecureIdentifier:contactId relay:relay];
|
recipient = [[SignalRecipient alloc] initWithTextSecureIdentifier:contactId relay:relay supportsVoice:YES];
|
||||||
|
[[Environment getCurrent].contactsManager lookupIdentifier:contactId
|
||||||
|
success:^(NSSet<NSString *> *matchedIds) {}
|
||||||
|
failure:^(NSError *error) {
|
||||||
|
DDLogInfo(@"Failed to retreive call status. Will be retreived on next contact intersection.");
|
||||||
|
}];
|
||||||
[recipient saveWithTransaction:transaction];
|
[recipient saveWithTransaction:transaction];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,12 +86,4 @@
|
||||||
return [threadId substringWithRange:NSMakeRange(1, threadId.length-1)];
|
return [threadId substringWithRange:NSMakeRange(1, threadId.length-1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (TSRecipient *)recipientWithTransaction:(YapDatabaseReadTransaction*)transaction{
|
|
||||||
TSRecipient *recipient = [TSRecipient recipientWithTextSecureIdentifier:self.contactIdentifier withTransaction:transaction];
|
|
||||||
if (!recipient){
|
|
||||||
recipient = [[TSRecipient alloc] initWithTextSecureIdentifier:self.contactIdentifier relay:nil];
|
|
||||||
}
|
|
||||||
return recipient;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -15,6 +15,5 @@
|
||||||
|
|
||||||
+ (instancetype)threadWithGroupModel:(TSGroupModel *)groupModel transaction:(YapDatabaseReadTransaction*)transaction;
|
+ (instancetype)threadWithGroupModel:(TSGroupModel *)groupModel transaction:(YapDatabaseReadTransaction*)transaction;
|
||||||
- (NSData*)groupId;
|
- (NSData*)groupId;
|
||||||
- (NSArray *)recipientsWithTransaction:(YapDatabaseReadTransaction*)transaction;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "TSGroupThread.h"
|
#import "TSGroupThread.h"
|
||||||
#import "TSRecipient.h"
|
#import "SignalRecipient.h"
|
||||||
#import "NSData+Base64.h"
|
#import "NSData+Base64.h"
|
||||||
|
|
||||||
@implementation TSGroupThread
|
@implementation TSGroupThread
|
||||||
|
@ -58,17 +58,4 @@
|
||||||
return [NSData dataFromBase64String:[threadId substringWithRange:NSMakeRange(1, threadId.length-1)]];
|
return [NSData dataFromBase64String:[threadId substringWithRange:NSMakeRange(1, threadId.length-1)]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *)recipientsWithTransaction:(YapDatabaseReadTransaction*)transaction{
|
|
||||||
NSMutableArray *recipients = [[NSMutableArray alloc] init];
|
|
||||||
|
|
||||||
for(NSString *recipientId in _groupModel.groupMemberIds) {
|
|
||||||
TSRecipient *recipient = [TSRecipient recipientWithTextSecureIdentifier:recipientId withTransaction:transaction];
|
|
||||||
if (!recipient){
|
|
||||||
recipient = [[TSRecipient alloc] initWithTextSecureIdentifier:recipientId relay:nil];
|
|
||||||
}
|
|
||||||
[recipients addObject:recipient];
|
|
||||||
}
|
|
||||||
return recipients;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
|
||||||
#import "ProtocolBuffers.h"
|
#import <ProtocolBuffers/ProtocolBuffers.h>
|
||||||
|
|
||||||
// @@protoc_insertion_point(imports)
|
// @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#import <Mantle/Mantle.h>
|
#import <Mantle/Mantle.h>
|
||||||
|
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
|
#import "ContactsManager+updater.h"
|
||||||
#import "PreferencesUtil.h"
|
#import "PreferencesUtil.h"
|
||||||
#import "NSData+messagePadding.h"
|
#import "NSData+messagePadding.h"
|
||||||
#import "TSStorageManager.h"
|
#import "TSStorageManager.h"
|
||||||
|
@ -48,7 +49,38 @@ dispatch_queue_t sendingQueue() {
|
||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendMessage:(TSOutgoingMessage*)message inThread:(TSThread*)thread
|
- (void)getRecipients:(NSArray<NSString*> *)identifiers
|
||||||
|
success:(void (^)(NSArray<SignalRecipient*>*))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
NSMutableArray<SignalRecipient*> *recipients = [NSMutableArray array];
|
||||||
|
for(NSString *recipientId in identifiers) {
|
||||||
|
__block SignalRecipient *recipient;
|
||||||
|
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction * _Nonnull transaction) {
|
||||||
|
recipient = [SignalRecipient recipientWithTextSecureIdentifier:recipientId withTransaction:transaction];
|
||||||
|
}];
|
||||||
|
|
||||||
|
if (!recipient){
|
||||||
|
[[self contactManager] synchronousLookup:recipientId success:^(SignalRecipient * newRecipient) {
|
||||||
|
[recipients addObject:newRecipient];
|
||||||
|
} failure:^(NSError *error) {
|
||||||
|
failure(error);
|
||||||
|
return;
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
success(recipients);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (ContactsManager*)contactManager {
|
||||||
|
return [Environment getCurrent].contactsManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)sendMessage:(TSOutgoingMessage*)message
|
||||||
|
inThread:(TSThread*)thread
|
||||||
success:(successSendingCompletionBlock)successCompletionBlock
|
success:(successSendingCompletionBlock)successCompletionBlock
|
||||||
failure:(failedSendingCompletionBlock)failedCompletionBlock
|
failure:(failedSendingCompletionBlock)failedCompletionBlock
|
||||||
{
|
{
|
||||||
|
@ -57,24 +89,43 @@ dispatch_queue_t sendingQueue() {
|
||||||
if ([thread isKindOfClass:[TSGroupThread class]]) {
|
if ([thread isKindOfClass:[TSGroupThread class]]) {
|
||||||
TSGroupThread* groupThread = (TSGroupThread*)thread;
|
TSGroupThread* groupThread = (TSGroupThread*)thread;
|
||||||
[self saveGroupMessage:message inThread:thread];
|
[self saveGroupMessage:message inThread:thread];
|
||||||
__block NSArray* recipients;
|
[self getRecipients:groupThread.groupModel.groupMemberIds success:^(NSArray<SignalRecipient *> *recipients) {
|
||||||
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
[self groupSend:recipients Message:message inThread:thread success:successCompletionBlock failure:failedCompletionBlock];
|
||||||
recipients = [groupThread recipientsWithTransaction:transaction];
|
} failure:^(NSError *error) {
|
||||||
|
DDLogError(@"Failure to retreive group recipient.");
|
||||||
|
[self saveMessage:message withState:TSOutgoingMessageStateUnsent];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self groupSend:recipients Message:message inThread:thread success:successCompletionBlock failure:failedCompletionBlock];
|
} else if([thread isKindOfClass:[TSContactThread class]]){
|
||||||
}
|
|
||||||
else if([thread isKindOfClass:[TSContactThread class]]){
|
|
||||||
TSContactThread *contactThread = (TSContactThread*)thread;
|
TSContactThread *contactThread = (TSContactThread*)thread;
|
||||||
|
|
||||||
[self saveMessage:message withState:TSOutgoingMessageStateAttemptingOut];
|
[self saveMessage:message withState:TSOutgoingMessageStateAttemptingOut];
|
||||||
|
|
||||||
if(![contactThread.contactIdentifier isEqualToString:[SignalKeyingStorage.localNumber toE164]]) {
|
if(![contactThread.contactIdentifier isEqualToString:[SignalKeyingStorage.localNumber toE164]]) {
|
||||||
__block TSRecipient *recipient;
|
__block SignalRecipient *recipient;
|
||||||
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||||
recipient = [contactThread recipientWithTransaction:transaction];
|
//recipient = [SignalRecipient recipientWithTextSecureIdentifier:contactThread.contactIdentifier
|
||||||
|
// withTransaction:transaction];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
if (!recipient) {
|
||||||
|
[[self contactManager] synchronousLookup:contactThread.contactIdentifier
|
||||||
|
success:^(SignalRecipient *recip) {
|
||||||
|
recipient = recip;
|
||||||
|
} failure:^(NSError *error) {
|
||||||
|
if (error.code == NOTFOUND_ERROR) {
|
||||||
|
[self unregisteredRecipient:recipient
|
||||||
|
message:message
|
||||||
|
inThread:thread];
|
||||||
|
return;
|
||||||
|
} else{
|
||||||
|
[self saveMessage:message withState:TSOutgoingMessageStateUnsent];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (recipient) {
|
||||||
[self sendMessage:message
|
[self sendMessage:message
|
||||||
toRecipient:recipient
|
toRecipient:recipient
|
||||||
inThread:thread
|
inThread:thread
|
||||||
|
@ -82,20 +133,20 @@ dispatch_queue_t sendingQueue() {
|
||||||
success:successCompletionBlock
|
success:successCompletionBlock
|
||||||
failure:failedCompletionBlock];
|
failure:failedCompletionBlock];
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
} else {
|
||||||
// Special situation: if we are sending to ourselves in a single thread, we treat this as an incoming message
|
// Special situation: if we are sending to ourselves in a single thread, we treat this as an incoming message
|
||||||
[self handleMessageSent:message];
|
[self handleMessageSent:message];
|
||||||
[[TSMessagesManager sharedManager] handleSendToMyself:message];
|
[[TSMessagesManager sharedManager] handleSendToMyself:message];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// For group sends, we're using chained futures to make the code more readable.
|
/// For group sends, we're using chained futures to make the code more readable.
|
||||||
|
|
||||||
- (TOCFuture*)sendMessageFuture:(TSOutgoingMessage*)message
|
- (TOCFuture*)sendMessageFuture:(TSOutgoingMessage*)message
|
||||||
recipient:(TSRecipient*)recipient
|
recipient:(SignalRecipient*)recipient
|
||||||
inThread:(TSThread*)thread {
|
inThread:(TSThread*)thread {
|
||||||
TOCFutureSource *futureSource = [[TOCFutureSource alloc] init];
|
TOCFutureSource *futureSource = [[TOCFutureSource alloc] init];
|
||||||
|
|
||||||
|
@ -108,7 +159,7 @@ dispatch_queue_t sendingQueue() {
|
||||||
return futureSource.future;
|
return futureSource.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)groupSend:(NSArray<TSRecipient*>*)recipients
|
- (void)groupSend:(NSArray<SignalRecipient*>*)recipients
|
||||||
Message:(TSOutgoingMessage*)message
|
Message:(TSOutgoingMessage*)message
|
||||||
inThread:(TSThread*)thread
|
inThread:(TSThread*)thread
|
||||||
success:(successSendingCompletionBlock)successBlock
|
success:(successSendingCompletionBlock)successBlock
|
||||||
|
@ -116,7 +167,7 @@ dispatch_queue_t sendingQueue() {
|
||||||
|
|
||||||
NSMutableArray<TOCFuture*> *futures = [NSMutableArray array];
|
NSMutableArray<TOCFuture*> *futures = [NSMutableArray array];
|
||||||
|
|
||||||
for(TSRecipient *rec in recipients){
|
for(SignalRecipient *rec in recipients){
|
||||||
// we don't need to send the message to ourselves, but otherwise we send
|
// we don't need to send the message to ourselves, but otherwise we send
|
||||||
if( ![[rec uniqueId] isEqualToString:[SignalKeyingStorage.localNumber toE164]]){
|
if( ![[rec uniqueId] isEqualToString:[SignalKeyingStorage.localNumber toE164]]){
|
||||||
[futures addObject:[self sendMessageFuture:message recipient:rec inThread:thread]];
|
[futures addObject:[self sendMessageFuture:message recipient:rec inThread:thread]];
|
||||||
|
@ -134,8 +185,21 @@ dispatch_queue_t sendingQueue() {
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)unregisteredRecipient:(SignalRecipient*)recipient
|
||||||
|
message:(TSOutgoingMessage*)message
|
||||||
|
inThread:(TSThread*)thread{
|
||||||
|
[self.dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
[recipient removeWithTransaction:transaction];
|
||||||
|
[[TSInfoMessage userNotRegisteredMessageInThread:thread transaction:transaction] saveWithTransaction:transaction];
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self saveMessage:message withState:TSOutgoingMessageStateUnsent];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void)sendMessage:(TSOutgoingMessage*)message
|
- (void)sendMessage:(TSOutgoingMessage*)message
|
||||||
toRecipient:(TSRecipient*)recipient
|
toRecipient:(SignalRecipient*)recipient
|
||||||
inThread:(TSThread*)thread
|
inThread:(TSThread*)thread
|
||||||
withAttemps:(int)remainingAttempts
|
withAttemps:(int)remainingAttempts
|
||||||
success:(successSendingCompletionBlock)successBlock
|
success:(successSendingCompletionBlock)successBlock
|
||||||
|
@ -146,7 +210,10 @@ dispatch_queue_t sendingQueue() {
|
||||||
remainingAttempts -= 1;
|
remainingAttempts -= 1;
|
||||||
|
|
||||||
[self outgoingMessages:message toRecipient:recipient inThread:thread completion:^(NSArray *messages) {
|
[self outgoingMessages:message toRecipient:recipient inThread:thread completion:^(NSArray *messages) {
|
||||||
TSSubmitMessageRequest *request = [[TSSubmitMessageRequest alloc] initWithRecipient:recipient.uniqueId messages:messages relay:recipient.relay timeStamp:message.timestamp];
|
TSSubmitMessageRequest *request = [[TSSubmitMessageRequest alloc] initWithRecipient:recipient.uniqueId
|
||||||
|
messages:messages
|
||||||
|
relay:recipient.relay
|
||||||
|
timeStamp:message.timestamp];
|
||||||
|
|
||||||
[[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) {
|
[[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
@ -161,12 +228,9 @@ dispatch_queue_t sendingQueue() {
|
||||||
|
|
||||||
switch (statuscode) {
|
switch (statuscode) {
|
||||||
case 404:{
|
case 404:{
|
||||||
DDLogError(@"Recipient not found");
|
[self unregisteredRecipient:recipient
|
||||||
[self.dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
message:message
|
||||||
[recipient removeWithTransaction:transaction];
|
inThread:thread];
|
||||||
[message setMessageState:TSOutgoingMessageStateUnsent];
|
|
||||||
[[TSInfoMessage userNotRegisteredMessageInThread:thread transaction:transaction] saveWithTransaction:transaction];
|
|
||||||
}];
|
|
||||||
BLOCK_SAFE_RUN(failureBlock);
|
BLOCK_SAFE_RUN(failureBlock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -236,7 +300,7 @@ dispatch_queue_t sendingQueue() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)handleMismatchedDevices:(NSDictionary*)dictionary recipient:(TSRecipient*)recipient {
|
- (void)handleMismatchedDevices:(NSDictionary*)dictionary recipient:(SignalRecipient*)recipient {
|
||||||
NSArray *extraDevices = [dictionary objectForKey:@"extraDevices"];
|
NSArray *extraDevices = [dictionary objectForKey:@"extraDevices"];
|
||||||
NSArray *missingDevices = [dictionary objectForKey:@"missingDevices"];
|
NSArray *missingDevices = [dictionary objectForKey:@"missingDevices"];
|
||||||
|
|
||||||
|
@ -261,7 +325,7 @@ dispatch_queue_t sendingQueue() {
|
||||||
[self saveMessage:message withState:TSOutgoingMessageStateSent];
|
[self saveMessage:message withState:TSOutgoingMessageStateSent];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)outgoingMessages:(TSOutgoingMessage*)message toRecipient:(TSRecipient*)recipient inThread:(TSThread*)thread completion:(messagesQueue)sendMessages{
|
- (void)outgoingMessages:(TSOutgoingMessage*)message toRecipient:(SignalRecipient*)recipient inThread:(TSThread*)thread completion:(messagesQueue)sendMessages{
|
||||||
NSMutableArray *messagesArray = [NSMutableArray arrayWithCapacity:recipient.devices.count];
|
NSMutableArray *messagesArray = [NSMutableArray arrayWithCapacity:recipient.devices.count];
|
||||||
TSStorageManager *storage = [TSStorageManager sharedManager];
|
TSStorageManager *storage = [TSStorageManager sharedManager];
|
||||||
NSData *plainText = [self plainTextForMessage:message inThread:thread];
|
NSData *plainText = [self plainTextForMessage:message inThread:thread];
|
||||||
|
@ -383,13 +447,17 @@ dispatch_queue_t sendingQueue() {
|
||||||
else if(message.groupMetaMessage==TSGroupMessageQuit) {
|
else if(message.groupMetaMessage==TSGroupMessageQuit) {
|
||||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
|
||||||
[[[TSInfoMessage alloc] initWithTimestamp:message.timestamp inThread:thread messageType:TSInfoMessageTypeGroupQuit] saveWithTransaction:transaction];
|
[[[TSInfoMessage alloc] initWithTimestamp:message.timestamp
|
||||||
|
inThread:thread
|
||||||
|
messageType:TSInfoMessageTypeGroupQuit] saveWithTransaction:transaction];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
|
|
||||||
[[[TSInfoMessage alloc] initWithTimestamp:message.timestamp inThread:thread messageType:TSInfoMessageTypeGroupUpdate] saveWithTransaction:transaction];
|
[[[TSInfoMessage alloc] initWithTimestamp:message.timestamp
|
||||||
|
inThread:thread
|
||||||
|
messageType:TSInfoMessageTypeGroupUpdate] saveWithTransaction:transaction];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
|
||||||
#import "ProtocolBuffers.h"
|
#import <ProtocolBuffers/ProtocolBuffers.h>
|
||||||
|
|
||||||
// @@protoc_insertion_point(imports)
|
// @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
|
||||||
- (void)deleteThreadsAndMessages {
|
- (void)deleteThreadsAndMessages {
|
||||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||||
[transaction removeAllObjectsInCollection:[TSThread collection]];
|
[transaction removeAllObjectsInCollection:[TSThread collection]];
|
||||||
[transaction removeAllObjectsInCollection:[TSRecipient collection]];
|
[transaction removeAllObjectsInCollection:[SignalRecipient collection]];
|
||||||
[transaction removeAllObjectsInCollection:[TSInteraction collection]];
|
[transaction removeAllObjectsInCollection:[TSInteraction collection]];
|
||||||
[transaction removeAllObjectsInCollection:[TSAttachment collection]];
|
[transaction removeAllObjectsInCollection:[TSAttachment collection]];
|
||||||
}];
|
}];
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* A bloom filter allows a set of items to be represented compactly, at the cost of false-positives when checking membership.
|
|
||||||
* When contains returns true, the given item may be in the set.
|
|
||||||
* When contains returns false, the given item is definitely not in the set.
|
|
||||||
*
|
|
||||||
* Bloom filters are used to opportunistically avoid starting an expensive operation that always fails for items not in a set.
|
|
||||||
* In the specific case of RedPhone, it is used to determine if a phone number can be called (i.e. is in the RedPhone directory).
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@interface BloomFilter : NSObject
|
|
||||||
|
|
||||||
@property (nonatomic,readonly) NSUInteger hashCount;
|
|
||||||
@property (nonatomic,readonly) NSData* data;
|
|
||||||
|
|
||||||
+(BloomFilter*) bloomFilterWithHashCount:(NSUInteger)hashCount
|
|
||||||
andData:(NSData*)data;
|
|
||||||
+(BloomFilter*) bloomFilterWithNothing;
|
|
||||||
+(BloomFilter*) bloomFilterWithEverything;
|
|
||||||
|
|
||||||
-(bool) contains:(NSString*)entity;
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,66 +0,0 @@
|
||||||
#import "BloomFilter.h"
|
|
||||||
#import "Constraints.h"
|
|
||||||
#import "Util.h"
|
|
||||||
#import "CryptoTools.h"
|
|
||||||
#import "Conversions.h"
|
|
||||||
|
|
||||||
@implementation BloomFilter
|
|
||||||
|
|
||||||
@synthesize hashCount, data;
|
|
||||||
|
|
||||||
+(BloomFilter*) bloomFilterWithNothing {
|
|
||||||
return [BloomFilter bloomFilterWithHashCount:1 andData:[NSMutableData dataWithLength:1]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+(BloomFilter*) bloomFilterWithEverything {
|
|
||||||
NSMutableData* data = [NSMutableData dataWithLength:1];
|
|
||||||
[data setUint8At:0 to:0xFF];
|
|
||||||
return [BloomFilter bloomFilterWithHashCount:1 andData:data];
|
|
||||||
}
|
|
||||||
|
|
||||||
+(BloomFilter*) bloomFilterWithHashCount:(NSUInteger)hashCount
|
|
||||||
andData:(NSData*)data {
|
|
||||||
require(hashCount > 0);
|
|
||||||
require(data != nil);
|
|
||||||
|
|
||||||
BloomFilter* result = [BloomFilter new];
|
|
||||||
result->hashCount = hashCount;
|
|
||||||
result->data = data;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
-(uint32_t) hash:(NSData*)value index:(NSUInteger)index {
|
|
||||||
NSData* key = [[@(index) stringValue] encodedAsAscii];
|
|
||||||
NSData* hash = [value hmacWithSha1WithKey:key];
|
|
||||||
return [hash bigEndianUInt32At:0] % (data.length * 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
-(bool) isBitSetAt:(uint32_t)bitIndex {
|
|
||||||
uint32_t byteIndex = bitIndex / 8;
|
|
||||||
uint8_t bitMask = (uint8_t)(1 << (bitIndex % 8));
|
|
||||||
return ([data uint8At:byteIndex] & bitMask) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-(bool) contains:(NSString*)entity {
|
|
||||||
require(entity != nil);
|
|
||||||
NSData* value = entity.encodedAsUtf8;
|
|
||||||
for (NSUInteger i = 0; i < hashCount; i++) {
|
|
||||||
uint32_t bitIndex = [self hash:value index:i];
|
|
||||||
if (![self isBitSetAt:bitIndex]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-(NSString*) description {
|
|
||||||
if (data.length == 1 && [data uint8At:0] == 0xFF) {
|
|
||||||
return @"Everything (degenerate bloom filter)";
|
|
||||||
}
|
|
||||||
if (data.length == 1 && [data uint8At:0] == 0) {
|
|
||||||
return @"Nothing (degenerate bloom filter)";
|
|
||||||
}
|
|
||||||
return [super description];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "ContactsManager.h"
|
#import "ContactsManager.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
#import "RPServerRequestsManager.h"
|
#import "RPServerRequestsManager.h"
|
||||||
#import "LocalizableText.h"
|
#import "LocalizableText.h"
|
||||||
#import "PushManager.h"
|
#import "PushManager.h"
|
||||||
|
@ -62,7 +61,6 @@
|
||||||
|
|
||||||
[self registerWithSuccess:^{
|
[self registerWithSuccess:^{
|
||||||
[_submitCodeSpinner stopAnimating];
|
[_submitCodeSpinner stopAnimating];
|
||||||
[Environment.getCurrent.phoneDirectoryManager forceUpdate];
|
|
||||||
|
|
||||||
[self.navigationController dismissViewControllerAnimated:YES completion:^{
|
[self.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||||
[self passedVerification];
|
[self passedVerification];
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#import "Contact.h"
|
#import "Contact.h"
|
||||||
#import "PhoneManager.h"
|
#import "PhoneManager.h"
|
||||||
#import "PhoneNumber.h"
|
#import "PhoneNumber.h"
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
|
|
||||||
#define PICK_UP_NOTIFICATION @"RedPhoneCallPickUpNotification"
|
#define PICK_UP_NOTIFICATION @"RedPhoneCallPickUpNotification"
|
||||||
#define HANG_UP_NOTIFICATION @"RedPhoneCallHangUpNotification"
|
#define HANG_UP_NOTIFICATION @"RedPhoneCallHangUpNotification"
|
||||||
|
|
|
@ -8,9 +8,8 @@
|
||||||
|
|
||||||
#import "MessageComposeTableViewController.h"
|
#import "MessageComposeTableViewController.h"
|
||||||
#import "Environment.h"
|
#import "Environment.h"
|
||||||
#import "NotificationManifest.h"
|
|
||||||
#import "PhoneNumberDirectoryFilterManager.h"
|
|
||||||
|
|
||||||
|
#import "ContactsManager+updater.h"
|
||||||
#import <MessageUI/MessageUI.h>
|
#import <MessageUI/MessageUI.h>
|
||||||
|
|
||||||
#import "ContactTableViewCell.h"
|
#import "ContactTableViewCell.h"
|
||||||
|
@ -59,19 +58,9 @@
|
||||||
-(void) viewDidAppear:(BOOL)animated {
|
-(void) viewDidAppear:(BOOL)animated {
|
||||||
[super viewDidAppear:animated];
|
[super viewDidAppear:animated];
|
||||||
|
|
||||||
BOOL isRefreshing = [Environment getCurrent].phoneDirectoryManager.isRefreshing;
|
|
||||||
if([contacts count]==0) {
|
if([contacts count]==0) {
|
||||||
if([Environment getCurrent].phoneDirectoryManager.isRefreshing) {
|
|
||||||
[self showLoadingBackgroundView:YES];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
[self showEmptyBackgroundView:YES];
|
[self showEmptyBackgroundView:YES];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if(isRefreshing) {
|
|
||||||
self.tableView.contentOffset = CGPointMake(0, -self.refreshControl.frame.size.height);
|
|
||||||
[self.refreshControl beginRefreshing];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(UILabel*) createLabelWithFirstLine:(NSString*) firstLine andSecondLine:(NSString*)secondLine {
|
-(UILabel*) createLabelWithFirstLine:(NSString*) firstLine andSecondLine:(NSString*)secondLine {
|
||||||
|
@ -214,15 +203,7 @@
|
||||||
sendTextButton.hidden = YES;
|
sendTextButton.hidden = YES;
|
||||||
|
|
||||||
[sendTextButton addTarget:self action:@selector(sendText) forControlEvents:UIControlEventTouchUpInside];
|
[sendTextButton addTarget:self action:@selector(sendText) forControlEvents:UIControlEventTouchUpInside];
|
||||||
[self initializeObservers];
|
|
||||||
[self initializeRefreshControl];
|
[self initializeRefreshControl];
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void)initializeObservers
|
|
||||||
{
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactsDidRefresh) name:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactRefreshFailed) name:NOTIFICATION_DIRECTORY_FAILED object:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)initializeRefreshControl {
|
-(void)initializeRefreshControl {
|
||||||
|
@ -332,9 +313,6 @@
|
||||||
sendTextButton.hidden = YES;
|
sendTextButton.hidden = YES;
|
||||||
self.searchController.searchBar.text = @"";
|
self.searchController.searchBar.text = @"";
|
||||||
|
|
||||||
[self dismissViewControllerAnimated:YES
|
|
||||||
completion:nil];
|
|
||||||
|
|
||||||
[self presentViewController:alertController
|
[self presentViewController:alertController
|
||||||
animated:YES
|
animated:YES
|
||||||
completion:[UIUtil modalCompletionBlock]];
|
completion:[UIUtil modalCompletionBlock]];
|
||||||
|
@ -443,19 +421,6 @@
|
||||||
|
|
||||||
#pragma mark Refresh controls
|
#pragma mark Refresh controls
|
||||||
|
|
||||||
- (void)contactRefreshFailed {
|
|
||||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:TIMEOUT message:TIMEOUT_CONTACTS_DETAIL delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil];
|
|
||||||
[alert show];
|
|
||||||
[self updateAfterRefreshTry];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)contactsDidRefresh {
|
|
||||||
contacts = [[Environment getCurrent] contactsManager].signalContacts;
|
|
||||||
[self updateSearchResultsForSearchController:self.searchController];
|
|
||||||
[self.tableView reloadData];
|
|
||||||
[self updateAfterRefreshTry];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) updateAfterRefreshTry {
|
- (void) updateAfterRefreshTry {
|
||||||
[self.refreshControl endRefreshing];
|
[self.refreshControl endRefreshing];
|
||||||
|
|
||||||
|
@ -469,9 +434,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)refreshContacts {
|
- (void)refreshContacts {
|
||||||
Environment *env = [Environment getCurrent];
|
[[Environment getCurrent].contactsManager updateSignalContactIntersectionWithSuccess:^{
|
||||||
PhoneNumberDirectoryFilterManager *manager = [env phoneDirectoryManager];
|
contacts = [[Environment getCurrent] contactsManager].signalContacts;
|
||||||
[manager forceUpdate];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self updateSearchResultsForSearchController:self.searchController];
|
||||||
|
[self.tableView reloadData];
|
||||||
|
[self updateAfterRefreshTry];
|
||||||
|
});
|
||||||
|
} failure:^(NSError *error) {
|
||||||
|
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:TIMEOUT
|
||||||
|
message:TIMEOUT_CONTACTS_DETAIL
|
||||||
|
delegate:nil
|
||||||
|
cancelButtonTitle:NSLocalizedString(@"OK", @"")
|
||||||
|
otherButtonTitles:nil];
|
||||||
|
[alert show];
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self updateAfterRefreshTry];
|
||||||
|
});
|
||||||
|
}];
|
||||||
|
|
||||||
if([contacts count]==0) {
|
if([contacts count]==0) {
|
||||||
[self showLoadingBackgroundView:YES];
|
[self showLoadingBackgroundView:YES];
|
||||||
}
|
}
|
||||||
|
|
|
@ -564,9 +564,17 @@ typedef enum : NSUInteger {
|
||||||
|
|
||||||
#pragma mark - Calls
|
#pragma mark - Calls
|
||||||
|
|
||||||
|
- (SignalRecipient*)signalRecipient {
|
||||||
|
__block SignalRecipient *recipient;
|
||||||
|
[self.editingDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||||
|
recipient = [SignalRecipient recipientWithTextSecureIdentifier:[self phoneNumberForThread].toE164 withTransaction:transaction];
|
||||||
|
}];
|
||||||
|
return recipient;
|
||||||
|
}
|
||||||
|
|
||||||
-(BOOL)isRedPhoneReachable
|
-(BOOL)isRedPhoneReachable
|
||||||
{
|
{
|
||||||
return [[Environment getCurrent].contactsManager isPhoneNumberRegisteredWithRedPhone:[self phoneNumberForThread]];
|
return [self signalRecipient].supportsVoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -575,11 +583,7 @@ typedef enum : NSUInteger {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
__block TSRecipient *recipient;
|
return [self signalRecipient];
|
||||||
[self.editingDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
|
||||||
recipient = [TSRecipient recipientWithTextSecureIdentifier:[self phoneNumberForThread].toE164 withTransaction:transaction];
|
|
||||||
}];
|
|
||||||
return recipient?YES:NO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
//
|
|
||||||
// BloomFilterTests.m
|
|
||||||
// Signal
|
|
||||||
//
|
|
||||||
// Created by Frederic Jacobs on 11/03/15.
|
|
||||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
#import "Cryptography.h"
|
|
||||||
#import "Environment.h"
|
|
||||||
|
|
||||||
@interface PropertyListPreferences()
|
|
||||||
- (NSData*)tryRetreiveBloomFilter;
|
|
||||||
- (void)storeBloomfilter:(NSData*)bloomFilterData;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface BloomFilterTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation BloomFilterTests
|
|
||||||
|
|
||||||
- (void)tearDown{
|
|
||||||
PropertyListPreferences *prefs = [Environment preferences];
|
|
||||||
[prefs storeBloomfilter:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testCreationRetreivalDeletion{
|
|
||||||
NSData *randomData = [Cryptography generateRandomBytes:30];
|
|
||||||
PropertyListPreferences *prefs = [Environment preferences];
|
|
||||||
|
|
||||||
NSData *bloomFilter = [prefs tryRetreiveBloomFilter];
|
|
||||||
|
|
||||||
XCTAssert(bloomFilter == nil);
|
|
||||||
|
|
||||||
[prefs storeBloomfilter:randomData];
|
|
||||||
bloomFilter = [prefs tryRetreiveBloomFilter];
|
|
||||||
|
|
||||||
XCTAssert([bloomFilter isEqualToData:randomData]);
|
|
||||||
|
|
||||||
[prefs storeBloomfilter:nil];
|
|
||||||
bloomFilter = [prefs tryRetreiveBloomFilter];
|
|
||||||
XCTAssert(bloomFilter == nil);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,5 +0,0 @@
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
@interface BloomFilterTest : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,27 +0,0 @@
|
||||||
#import "BloomFilterTest.h"
|
|
||||||
#import "BloomFilter.h"
|
|
||||||
#import "TestUtil.h"
|
|
||||||
|
|
||||||
@implementation BloomFilterTest
|
|
||||||
|
|
||||||
-(void) testEmptyBloomFilter {
|
|
||||||
NSMutableData* d = [NSMutableData dataWithLength:100];
|
|
||||||
BloomFilter* b = [BloomFilter bloomFilterWithHashCount:5 andData:d];
|
|
||||||
NSArray* keys = @[@"", @"a", @"wonder", @"b"];
|
|
||||||
for (NSString* key in keys) {
|
|
||||||
test(![b contains:key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-(void) testFullBloomFilter {
|
|
||||||
NSMutableData* d = [NSMutableData dataWithLength:100];
|
|
||||||
for (NSUInteger i = 0; i < 100; i++) {
|
|
||||||
[d setUint8At:i to:0xFF];
|
|
||||||
}
|
|
||||||
BloomFilter* b = [BloomFilter bloomFilterWithHashCount:5 andData:d];
|
|
||||||
NSArray* keys = @[@"", @"a", @"wonder", @"b"];
|
|
||||||
for (NSString* key in keys) {
|
|
||||||
test([b contains:key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
Loading…
Reference in a new issue