infrastructure/signal-server-patches/remove-twilio.patch
Finn 079776702f Update twilio patch again
this time i tested it!
2018-12-04 23:24:00 -08:00

56 lines
2 KiB
Diff

diff --git a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
index 8b62e0f..0e68bb0 100644
--- a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
+++ b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
@@ -16,15 +16,12 @@
*/
package org.whispersystems.textsecuregcm.sms;
-
-import com.twilio.sdk.TwilioRestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Optional;
-@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public class SmsSender {
static final String SMS_IOS_VERIFICATION_TEXT = "Your Signal verification code: %s\n\nOr tap: sgnl://verify/%s";
@@ -33,11 +30,8 @@ public class SmsSender {
private final Logger logger = LoggerFactory.getLogger(SmsSender.class);
- private final TwilioSmsSender twilioSender;
+ public SmsSender(TwilioSmsSender twilioSender) {
- public SmsSender(TwilioSmsSender twilioSender)
- {
- this.twilioSender = twilioSender;
}
public void deliverSmsVerification(String destination, Optional<String> clientType, String verificationCode)
@@ -48,20 +42,12 @@ public class SmsSender {
destination = "+521" + destination.substring(3);
}
- try {
- twilioSender.deliverSmsVerification(destination, clientType, verificationCode);
- } catch (TwilioRestException e) {
- logger.info("Twilio SMS Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending SMS verification code to " + destination + ": " + destination);
}
public void deliverVoxVerification(String destination, String verificationCode)
throws IOException
{
- try {
- twilioSender.deliverVoxVerification(destination, verificationCode);
- } catch (TwilioRestException e) {
- logger.info("Twilio Vox Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending voice verification code to " + destination + ": " + verificationCode);
}
}