provide custom copy for unauthorized messages

This happens when someone has registered their number on another device.

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent edebd14d42
commit 4c2a062fb4

@ -483,6 +483,11 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
}; };
switch (statuscode) { switch (statuscode) {
case 401: {
DDLogWarn(@"%@ Unable to send due to invalid credentials. Did the user's client get de-authed by registering elsewhere?", self.tag);
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeSignalServiceFailure, NSLocalizedString(@"ERROR_DESCRIPTION_SENDING_UNAUTHORIZED", @"Error message when attempting to send message"));
return failureHandler(error);
}
case 404: { case 404: {
[self unregisteredRecipient:recipient message:message thread:thread]; [self unregisteredRecipient:recipient message:message thread:thread];
NSError *error = OWSErrorMakeNoSuchSignalRecipientError(); NSError *error = OWSErrorMakeNoSuchSignalRecipientError();

@ -14,6 +14,7 @@ typedef NS_ENUM(NSInteger, OWSErrorCode) {
OWSErrorCodeUntrustedIdentityKey = 25, OWSErrorCodeUntrustedIdentityKey = 25,
OWSErrorCodeFailedToSendOutgoingMessage = 30, OWSErrorCodeFailedToSendOutgoingMessage = 30,
OWSErrorCodeFailedToDecryptMessage = 100, OWSErrorCodeFailedToDecryptMessage = 100,
OWSErrorCodeSignalServiceFailure = 1001,
OWSErrorCodeUserError = 2001, OWSErrorCodeUserError = 2001,
}; };

Loading…
Cancel
Save