IOSAD-172 Rename internal constructor

IOSAD-172
Dirk Zimmermann 2 years ago
parent 55baa3078e
commit 93ece00357
  1. 11
      pEpObjCAdapter/PEPPassphraseCache.m
  2. 4
      pEpObjCAdapter/PEPPassphraseCacheInternal.h
  3. 4
      pEpObjCTests/PEPPassphraseCacheTest.m

@ -14,7 +14,7 @@
static NSUInteger s_maxNumberOfPassphrases = 20;
static NSTimeInterval s_defaultTimeoutInSeconds = 10 * 60;
static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
static NSTimeInterval s_defaultCheckExpiryInterval = 60;
@interface PEPPassphraseCache ()
@ -26,8 +26,8 @@ static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
@implementation PEPPassphraseCache
/// Internal constructor (for now).
- (instancetype)initWithTimeout:(NSTimeInterval)timeout
removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval
- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
checkExpiryInterval:(NSTimeInterval)checkExpiryInterval
{
self = [super init];
if (self) {
@ -41,9 +41,8 @@ static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
/// Public constructor with default values.
- (instancetype)init
{
return [self
initWithTimeout:s_defaultTimeoutInSeconds
removeStalePassphrasesInterval:s_defaultRemoveStalePassphrasesInterval];
return [self initWithPassphraseTimeout:s_defaultTimeoutInSeconds
checkExpiryInterval:s_defaultCheckExpiryInterval];
}
- (void)addPassphrase:(NSString *)passphrase

@ -12,8 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface PEPPassphraseCache (internal)
- (instancetype)initWithTimeout:(NSTimeInterval)timeout
removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval;
- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
checkExpiryInterval:(NSTimeInterval)checkExpiryInterval;
@end

@ -91,8 +91,8 @@
{
NSTimeInterval timeout = 0.5;
PEPPassphraseCache *ownCache = [[PEPPassphraseCache alloc]
initWithTimeout:timeout
removeStalePassphrasesInterval:timeout];
initWithPassphraseTimeout:timeout
checkExpiryInterval:timeout];
NSString *ownPassphrase = @"blah";
[ownCache addPassphrase:ownPassphrase];

Loading…
Cancel
Save