diff --git a/Podfile b/Podfile index 8fd239f14..ffd1c3806 100644 --- a/Podfile +++ b/Podfile @@ -6,6 +6,7 @@ target 'Signal' do pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' #pod 'AxolotlKit', path: '../SignalProtocolKit' pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' + #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', :branch => 'charlesmchen/rateLimitingErrorMessage' #pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'OpenSSL' pod 'PastelogKit', '~> 1.3' diff --git a/Podfile.lock b/Podfile.lock index da112d5cf..27b757ebc 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -56,8 +56,8 @@ PODS: - TwistedOakCollapsingFutures - YapDatabase/SQLCipher - SocketRocket (0.5.1) - - SQLCipher/common (3.4.0) - - SQLCipher/fts (3.4.0): + - SQLCipher/common (3.4.1) + - SQLCipher/fts (3.4.1): - SQLCipher/common - TwistedOakCollapsingFutures (1.0.0): - UnionFind (~> 1.0) @@ -140,7 +140,7 @@ CHECKOUT OPTIONS: :commit: 945c04f9e70f7119d2ada4edb938849f3b7febab :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: 93219e4d23e07b3734fb8df4a2d244b26fcecd59 + :commit: 12027152f4bffd650badad73203bff788684d76d :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 @@ -166,12 +166,12 @@ SPEC CHECKSUMS: SCWaveformView: 52a96750255d817e300565a80c81fb643e233e07 SignalServiceKit: 59a79a51b89b963ba94db30cc99ed5212da0bb9f SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e - SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff + SQLCipher: 43d12c0eb9c57fb438749618fc3ce0065509a559 TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a -PODFILE CHECKSUM: 48dbf2fb380d626bb799a782dd41b6bf1e466506 +PODFILE CHECKSUM: 23ca4df281ad1e794af6967db2047f43df88e96a COCOAPODS: 1.1.1 diff --git a/Signal/src/view controllers/CodeVerificationViewController.m b/Signal/src/view controllers/CodeVerificationViewController.m index 095fffaae..4f80500f9 100644 --- a/Signal/src/view controllers/CodeVerificationViewController.m +++ b/Signal/src/view controllers/CodeVerificationViewController.m @@ -11,6 +11,7 @@ #import #import #import +#import #import NS_ASSUME_NONNULL_BEGIN @@ -269,10 +270,21 @@ NSString *const kCompletedRegistrationSegue = @"CompletedRegistration"; - (void)presentAlertWithVerificationError:(NSError *)error { - UIAlertController *alertController = [UIAlertController - alertControllerWithTitle:NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_TITLE", @"Alert view title") - message:error.localizedDescription - preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *alertController; + // In the case of the "rate limiting" error, we want to show the + // "recovery suggestion", not the error's "description." + if ([error.domain isEqualToString:TSNetworkManagerDomain] && + error.code == 413) { + alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_TITLE", + @"Alert view title") + message:error.localizedRecoverySuggestion + preferredStyle:UIAlertControllerStyleAlert]; + } else { + alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_TITLE", + @"Alert view title") + message:error.localizedDescription + preferredStyle:UIAlertControllerStyleAlert]; + } UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 7556810f4..2c13c6b34 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -649,7 +649,7 @@ "REGISTER_FAILED_TRY_AGAIN" = "Try again"; /* No comment provided by engineer. */ -"REGISTER_RATE_LIMITING_BODY" = "The server is currently rate-limiting signups, please try again later."; +"REGISTER_RATE_LIMITING_BODY" = "You have tried too often. Please wait a minute before trying again."; /* No comment provided by engineer. */ "REGISTERED_NUMBER_TEXT" = "Registered Number";