mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 11:46:53 +00:00
Only send verification code push notifications to primary devices
This commit is contained in:
1 parent
9f6d80cb39
commit
cb6123125f
3 files changed
+25
-23
No files matched your search
+5
-3
@@ -75,6 +75,7 @@ import org.whispersystems.textsecuregcm.mappers.NonNormalizedPhoneNumberExceptio
|
||||
import org.whispersystems.textsecuregcm.mappers.ObsoletePhoneNumberFormatExceptionMapper;
|
||||
import org.whispersystems.textsecuregcm.mappers.RateLimitExceededExceptionMapper;
|
||||
import org.whispersystems.textsecuregcm.mappers.RegistrationServiceSenderExceptionMapper;
|
||||
import org.whispersystems.textsecuregcm.push.NotPushRegisteredException;
|
||||
import org.whispersystems.textsecuregcm.push.PushNotificationManager;
|
||||
import org.whispersystems.textsecuregcm.registration.RegistrationFraudException;
|
||||
import org.whispersystems.textsecuregcm.registration.RegistrationServiceClient;
|
||||
@@ -1079,7 +1080,8 @@ class VerificationControllerTest {
|
||||
|
||||
@CartesianTest
|
||||
void requestVerificationCodeSuccess(@CartesianTest.Values(booleans = {true, false}) final boolean accountExistsWithNumber,
|
||||
@CartesianTest.Values(booleans = {true, false}) final boolean enrolledInExperiment) {
|
||||
@CartesianTest.Values(booleans = {true, false}) final boolean enrolledInExperiment)
|
||||
throws NotPushRegisteredException {
|
||||
final String encodedSessionId = encodeSessionId(SESSION_ID);
|
||||
final RegistrationServiceSession registrationServiceSession = new RegistrationServiceSession(SESSION_ID, NUMBER,
|
||||
false, null, null,
|
||||
@@ -1118,9 +1120,9 @@ class VerificationControllerTest {
|
||||
assertTrue(verificationSessionResponse.requestedInformation().isEmpty());
|
||||
|
||||
if (accountExistsWithNumber && enrolledInExperiment) {
|
||||
verify(pushNotificationManager).trySendVerificationCodeRequestedNotifications(existingAccount, clock.instant());
|
||||
verify(pushNotificationManager).sendVerificationCodeRequestedNotifications(existingAccount, clock.instant());
|
||||
} else {
|
||||
verify(pushNotificationManager, never()).trySendVerificationCodeRequestedNotifications(any(), any());
|
||||
verify(pushNotificationManager, never()).sendVerificationCodeRequestedNotifications(any(), any());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user