CR: comments and code clarity

pull/1/head
Michael Kirk 7 years ago
parent 3bef78335d
commit 3d9cd4f4ed

@ -1902,7 +1902,7 @@ typedef enum : NSUInteger {
// as-of-yet-undecrypted messages
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) {
// Deliberately crash if the user fails to explicitly accept the new identity
// key. In practice we haven't been creating these messags in over a year.
// key. In practice we haven't been creating these messages in over a year.
[errorMessage throws_acceptNewIdentityKey];
}
}];

@ -159,7 +159,7 @@ NSString *const TSAccountManager_NeedsAccountAttributesUpdateKey = @"TSAccountMa
NSString *phoneNumber = self.phoneNumberAwaitingVerification;
if (!phoneNumber) {
OWSFail(@"phonNumber was unexpectedly nil");
OWSFail(@"phoneNumber was unexpectedly nil");
}
[self storeLocalNumber:phoneNumber];

@ -1609,7 +1609,6 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
}) retainUntilComplete];
}
// NOTE: This method uses exceptions for control flow.
- (NSDictionary *)throws_encryptedMessageForMessageSend:(OWSMessageSend *)messageSend
deviceId:(NSNumber *)deviceId
plainText:(NSData *)plainText

@ -30,14 +30,15 @@ NSString *const OWSPrimaryStorageKeyPrekeyCurrentSignedPrekeyId = @"currentSigne
int preKeyId = 1 + arc4random_uniform(INT32_MAX - 1);
ECKeyPair *_Nullable identityKeyPair = [[OWSIdentityManager sharedManager] identityKeyPair];
OWSAssert(identityKeyPair);
@try {
return [[SignedPreKeyRecord alloc]
initWithId:preKeyId
keyPair:keyPair
signature:[Ed25519 throws_sign:keyPair.publicKey.prependKeyType withKeyPair:identityKeyPair]
generatedAt:[NSDate date]];
NSData *signature = [Ed25519 throws_sign:keyPair.publicKey.prependKeyType withKeyPair:identityKeyPair];
return [[SignedPreKeyRecord alloc] initWithId:preKeyId
keyPair:keyPair
signature:signature
generatedAt:[NSDate date]];
} @catch (NSException *exception) {
// throws_sign only throws when the data to sign is empty or `keyPair`.
// throws_sign only throws when the data to sign is empty or `keyPair` is nil.
// Neither of which should happen.
OWSFail(@"exception: %@", exception);
return nil;

Loading…
Cancel
Save