mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
Matlab
36 lines
1.0 KiB
Matlab
5 years ago
|
//
|
||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "OWSPrimaryStorage+Calling.h"
|
||
|
#import "YapDatabaseConnection+OWS.h"
|
||
|
#import <SessionProtocolKit/SessionProtocolKit.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
NSString *const OWSPrimaryStorageCallKitIdToPhoneNumberCollection = @"TSStorageManagerCallKitIdToPhoneNumberCollection";
|
||
|
|
||
|
@implementation OWSPrimaryStorage (Calling)
|
||
|
|
||
|
- (void)setPhoneNumber:(NSString *)phoneNumber forCallKitId:(NSString *)callKitId
|
||
|
{
|
||
|
OWSAssertDebug(phoneNumber.length > 0);
|
||
|
OWSAssertDebug(callKitId.length > 0);
|
||
|
|
||
|
[self.dbReadWriteConnection setObject:phoneNumber
|
||
|
forKey:callKitId
|
||
|
inCollection:OWSPrimaryStorageCallKitIdToPhoneNumberCollection];
|
||
|
}
|
||
|
|
||
|
- (NSString *)phoneNumberForCallKitId:(NSString *)callKitId
|
||
|
{
|
||
|
OWSAssertDebug(callKitId.length > 0);
|
||
|
|
||
|
return
|
||
|
[self.dbReadConnection objectForKey:callKitId inCollection:OWSPrimaryStorageCallKitIdToPhoneNumberCollection];
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|