Turn off alphanumeric sender ID for all countries.

This commit is contained in:
Jon Chambers 2021-01-08 05:26:25 -05:00 committed by Jon Chambers
parent 91fc0fd623
commit 3bf0188e7f
2 changed files with 10 additions and 2 deletions

View File

@ -37,11 +37,12 @@ class SenderIdSupplier {
}
Optional<String> get(@NotNull String destination) {
final String countryCode = Util.getCountryCode(destination);
/* final String countryCode = Util.getCountryCode(destination);
if (countryCodesWithoutSenderId.contains(countryCode)) {
return Optional.empty();
}
return Optional.ofNullable(StringUtils.stripToNull(countrySpecificSenderIds.getOrDefault(countryCode, defaultSenderId)));
return Optional.ofNullable(StringUtils.stripToNull(countrySpecificSenderIds.getOrDefault(countryCode, defaultSenderId))); */
return Optional.empty();
}
}

View File

@ -6,6 +6,7 @@
package org.whispersystems.textsecuregcm.tests.sms;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.whispersystems.textsecuregcm.configuration.TwilioConfiguration;
@ -214,6 +215,7 @@ public class TwilioSmsSenderTest {
.withRequestBody(equalTo(expectedRequestBody)));
}
@Ignore
@Test
public void testSendAlphaIdByCountryCode() {
runSenderIdTest("+85278675309", "SIGNAL", () -> {
@ -226,6 +228,7 @@ public class TwilioSmsSenderTest {
});
}
@Ignore
@Test
public void testDefaultSenderId() {
runSenderIdTest("+14098675309", "SIGNALFOO", () -> {
@ -235,6 +238,7 @@ public class TwilioSmsSenderTest {
});
}
@Ignore
@Test
public void testDefaultSenderIdWithDisabledCountry() {
final Supplier<TwilioSenderIdConfiguration> senderIdConfigurationSupplier = () -> {
@ -247,6 +251,7 @@ public class TwilioSmsSenderTest {
runSenderIdTest("+447911123456", "SIGNALBAR", senderIdConfigurationSupplier);
}
@Ignore
@Test
public void testDefaultSenderIdWithOverriddenCountry() {
final Supplier<TwilioSenderIdConfiguration> senderIdConfigurationSupplier = () -> {
@ -262,6 +267,7 @@ public class TwilioSmsSenderTest {
runSenderIdTest("+6433456789", "JUSTREADTHEINSTRUCTIONS", senderIdConfigurationSupplier);
}
@Ignore
@Test
public void testSenderIdWithAllFieldsPopulated() {
final Supplier<TwilioSenderIdConfiguration> senderIdConfigurationSupplier = () -> {
@ -304,6 +310,7 @@ public class TwilioSmsSenderTest {
.withRequestBody(equalTo("MessagingServiceSid=test_messaging_services_id&To=%2B14153333333&Body=%3C%23%3E+Verify+on+AndroidNg%3A+123-456%0A%0Acharacters")));
}
@Ignore
@Test
public void testRetrySmsOnUnreachableErrorCodeSkipsSenderIdSecondTime() {
wireMockRule.stubFor(post(urlEqualTo("/2010-04-01/Accounts/" + ACCOUNT_ID + "/Messages.json"))