mirror of https://github.com/oxen-io/session-ios
Merge branch 'charlesmchen/callkitPrivacy'
commit
d6e1e81a8a
@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TSStorageManager.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface TSStorageManager (Calling)
|
||||||
|
|
||||||
|
// phoneNumber is an e164 formatted phone number.
|
||||||
|
//
|
||||||
|
// callKitId is expected to have CallKitCallManager.kAnonymousCallHandlePrefix.
|
||||||
|
- (void)setPhoneNumber:(NSString *)phoneNumber forCallKitId:(NSString *)callKitId;
|
||||||
|
|
||||||
|
// returns an e164 formatted phone number or nil if no
|
||||||
|
// record can be found.
|
||||||
|
//
|
||||||
|
// callKitId is expected to have CallKitCallManager.kAnonymousCallHandlePrefix.
|
||||||
|
- (NSString *)phoneNumberForCallKitId:(NSString *)callKitId;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TSStorageManager+Calling.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
NSString *const TSStorageManagerCallKitIdToPhoneNumberCollection = @"TSStorageManagerCallKitIdToPhoneNumberCollection";
|
||||||
|
|
||||||
|
@implementation TSStorageManager (Calling)
|
||||||
|
|
||||||
|
- (void)setPhoneNumber:(NSString *)phoneNumber forCallKitId:(NSString *)callKitId
|
||||||
|
{
|
||||||
|
OWSAssert(phoneNumber.length > 0);
|
||||||
|
OWSAssert(callKitId.length > 0);
|
||||||
|
|
||||||
|
[self setObject:phoneNumber forKey:callKitId inCollection:TSStorageManagerCallKitIdToPhoneNumberCollection];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)phoneNumberForCallKitId:(NSString *)callKitId
|
||||||
|
{
|
||||||
|
OWSAssert(callKitId.length > 0);
|
||||||
|
|
||||||
|
return [self objectForKey:callKitId inCollection:TSStorageManagerCallKitIdToPhoneNumberCollection];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Loading…
Reference in New Issue