From 8093b14922cc0f6bd056c60d8a17d220d7794219 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Sun, 23 Feb 2014 14:38:41 -0800 Subject: [PATCH] Be sure we don't let MMS out if the transport is disabled. --- src/org/thoughtcrime/securesms/transport/MmsTransport.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/thoughtcrime/securesms/transport/MmsTransport.java b/src/org/thoughtcrime/securesms/transport/MmsTransport.java index 318beff89d..3bb2a04f45 100644 --- a/src/org/thoughtcrime/securesms/transport/MmsTransport.java +++ b/src/org/thoughtcrime/securesms/transport/MmsTransport.java @@ -31,6 +31,7 @@ import org.thoughtcrime.securesms.protocol.WirePrefix; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.RecipientFactory; import org.thoughtcrime.securesms.recipients.RecipientFormattingException; +import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.whispersystems.textsecure.crypto.MasterSecret; import org.whispersystems.textsecure.crypto.SessionCipher; import org.whispersystems.textsecure.crypto.protocol.CiphertextMessage; @@ -62,6 +63,12 @@ public class MmsTransport { } public MmsSendResult deliver(SendReq message) throws UndeliverableMessageException { + if (TextSecurePreferences.isPushRegistered(context) && + !TextSecurePreferences.isSmsFallbackEnabled(context)) + { + throw new UndeliverableMessageException("MMS Transport is not enabled!"); + } + try { if (isCdmaDevice()) { Log.w("MmsTransport", "Sending MMS directly without radio change...");