4 #import "keychain/ot/OctagonPendingFlag.h"
6 NSString* OctagonPendingConditionsToString(OctagonPendingConditions cond)
8 if((cond & OctagonPendingConditionsDeviceUnlocked) != 0x0) {
14 return [NSString stringWithFormat:@"Unknown conditions: 0x%x", (int)cond];
17 @implementation OctagonPendingFlag
19 - (instancetype)initWithFlag:(OctagonFlag*)flag delayInSeconds:(NSTimeInterval)delay
21 if ((self = [super init])) {
23 _fireTime = [NSDate dateWithTimeIntervalSinceNow:delay];
29 - (instancetype)initWithFlag:(OctagonFlag*)flag
30 conditions:(OctagonPendingConditions)conditions
32 if ((self = [super init])) {
35 _conditions = conditions;
40 - (NSString*)description {
42 return [NSString stringWithFormat:@"<OctagonPendingFlag: %@: %@>", self.flag, self.fireTime];
44 return [NSString stringWithFormat:@"<OctagonPendingFlag: %@: %@>", self.flag, OctagonPendingConditionsToString(self.conditions)];