From c19733e04abe1faae8012d6ebff756215a7214f2 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Mon, 16 Dec 2019 09:17:31 +1100 Subject: [PATCH] Disable insecure sms option --- .../thoughtcrime/securesms/TransportOptions.java | 14 ++------------ .../conversation/ConversationActivity.java | 3 +++ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/org/thoughtcrime/securesms/TransportOptions.java b/src/org/thoughtcrime/securesms/TransportOptions.java index 39400b7ddc..00ed7f42d3 100644 --- a/src/org/thoughtcrime/securesms/TransportOptions.java +++ b/src/org/thoughtcrime/securesms/TransportOptions.java @@ -32,7 +32,7 @@ public class TransportOptions { private final Context context; private final List enabledTransports; - private Type defaultTransportType = Type.SMS; + private Type defaultTransportType = Type.TEXTSECURE; private Optional defaultSubscriptionId = Optional.absent(); private Optional selectedOption = Optional.absent(); @@ -53,7 +53,7 @@ public class TransportOptions { if (selectedOption.isPresent() && !isEnabled(selectedOption.get())) { setSelectedTransport(null); } else { - this.defaultTransportType = Type.SMS; + this.defaultTransportType = Type.TEXTSECURE; this.defaultSubscriptionId = Optional.absent(); notifyTransportChangeListeners(); @@ -149,16 +149,6 @@ public class TransportOptions { private List initializeAvailableTransports(boolean isMediaMessage) { List results = new LinkedList<>(); - if (isMediaMessage) { - results.addAll(getTransportOptionsForSimCards(context.getString(R.string.ConversationActivity_transport_insecure_mms), - context.getString(R.string.conversation_activity__type_message_mms_insecure), - new MmsCharacterCalculator())); - } else { - results.addAll(getTransportOptionsForSimCards(context.getString(R.string.ConversationActivity_transport_insecure_sms), - context.getString(R.string.conversation_activity__type_message_sms_insecure), - new SmsCharacterCalculator())); - } - results.add(new TransportOption(Type.TEXTSECURE, R.drawable.ic_send_push_white_24dp, context.getResources().getColor(R.color.textsecure_primary), context.getString(R.string.ConversationActivity_transport_signal), diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 84f3c11da5..624edfd560 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -1258,7 +1258,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity boolean isMediaMessage = recipient.isMmsGroupRecipient() || attachmentManager.isAttachmentPresent(); sendButton.resetAvailableTransports(isMediaMessage); + sendButton.setDefaultTransport(Type.TEXTSECURE); + /* Loki - We don't support SMS if (!isSecureText && !isPushGroupConversation()) sendButton.disableTransport(Type.TEXTSECURE); if (recipient.isPushGroupRecipient()) sendButton.disableTransport(Type.SMS); @@ -1268,6 +1270,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity if (isSecureText || isPushGroupConversation()) sendButton.setDefaultTransport(Type.TEXTSECURE); else sendButton.setDefaultTransport(Type.SMS); } + */ calculateCharactersRemaining(); supportInvalidateOptionsMenu();