mirror of https://github.com/oxen-io/session-ios
parent
286f72d273
commit
71b804ba52
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TSStorageManager.h"
|
||||||
|
|
||||||
|
@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
|
@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "TSStorageManager+Calling.h"
|
||||||
|
|
||||||
|
#define 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
|
Loading…
Reference in New Issue