Show no redundant error when failing to send due to changed identity

The old "blocking" style SN alerts are deprecated. We maintain the
functionality to decrypt incoming messages from legacy SN alerts so that
users have time to recover their undecrypted messages.

// FREEBIE
This commit is contained in:
Michael Kirk 2017-06-07 23:30:51 -04:00
parent 894893ceb8
commit 75bab75dc8
4 changed files with 14 additions and 21 deletions

View File

@ -5,8 +5,8 @@ target 'Signal' do
pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git'
pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git'
#pod 'AxolotlKit', path: '../SignalProtocolKit'
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
#pod 'SignalServiceKit', path: '../SignalServiceKit'
#pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
pod 'SignalServiceKit', path: '../SignalServiceKit'
pod 'OpenSSL'
pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu'
#pod 'JSQMessagesViewController' path: '../JSQMessagesViewController'

View File

@ -114,7 +114,7 @@ DEPENDENCIES:
- OpenSSL
- PureLayout
- Reachability
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`)
- SignalServiceKit (from `../SignalServiceKit`)
- SocketRocket (from `https://github.com/facebook/SocketRocket.git`)
EXTERNAL SOURCES:
@ -124,7 +124,7 @@ EXTERNAL SOURCES:
:branch: mkirk/position-edit-menu
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
SignalServiceKit:
:git: https://github.com/WhisperSystems/SignalServiceKit.git
:path: "../SignalServiceKit"
SocketRocket:
:git: https://github.com/facebook/SocketRocket.git
@ -135,9 +135,6 @@ CHECKOUT OPTIONS:
JSQMessagesViewController:
:commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
SignalServiceKit:
:commit: edc6578b9baca780d1489aeb205f1bb778f37bce
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf
:git: https://github.com/facebook/SocketRocket.git
@ -164,6 +161,6 @@ SPEC CHECKSUMS:
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266
PODFILE CHECKSUM: 48e80d7f1e049bbf544a689fdfdf33e8196c640a
PODFILE CHECKSUM: 6f9ef5d9fa17469569e127a9f5719dafa11631b9
COCOAPODS: 1.2.1

View File

@ -79,7 +79,7 @@
#import <SignalServiceKit/SignalRecipient.h>
#import <SignalServiceKit/TSAccountManager.h>
#import <SignalServiceKit/TSGroupModel.h>
#import <SignalServiceKit/TSInvalidIdentityKeySendingErrorMessage.h>
#import <SignalServiceKit/TSInvalidIdentityKeyReceivingErrorMessage.h>
#import <SignalServiceKit/TSMessagesManager.h>
#import <SignalServiceKit/TSNetworkManager.h>
#import <SignalServiceKit/Threading.h>
@ -2355,16 +2355,12 @@ typedef enum : NSUInteger {
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
DDLogInfo(@"%@ Remote Key Changed actions: Accepted new identity key", self.tag);
[errorMessage acceptNewIdentityKey];
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeySendingErrorMessage class]]) {
[self.messageSender
resendMessageFromKeyError:(TSInvalidIdentityKeySendingErrorMessage *)errorMessage
success:^{
DDLogDebug(@"%@ Successfully resent key-error message.", self.tag);
}
failure:^(NSError *_Nonnull error) {
DDLogError(@"%@ Failed to resend key-error message with error:%@", self.tag, error);
}];
// DEPRECATED: we're no longer creating these incoming SN error's per message,
// but there will be some legacy ones in the wild, behind which await as-of-yet-undecrypted
// messages
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) {
[errorMessage acceptNewIdentityKey];
}
}];
[actionSheetController addAction:acceptSafetyNumberAction];

View File

@ -518,7 +518,7 @@
"FAILED_SENDING_BECAUSE_RATE_LIMIT" = "Too many failures with this contact. Please try again shortly.";
/* action sheet header when re-sending message which failed because of untrusted identity keys */
"FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY" = "You must accept the new safety number before you will be able to send.";
"FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY" = "Recipient's safety number recently changed. You may wish to verify before resending.";
/* alert title */
"FAILED_VERIFICATION_TITLE" = "Failed to Verify Safety Number!";
@ -704,7 +704,7 @@
"MESSAGE_STATUS_DELIVERED" = "Delivered";
/* message footer for failed messages */
"MESSAGE_STATUS_FAILED" = "Sending failed. Tap to retry.";
"MESSAGE_STATUS_FAILED" = "Sending failed. Tap for info.";
/* message footer for sent messages */
"MESSAGE_STATUS_SENT" = "Sent";