mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
Merge pull request #57 from loki-project/disable-sms
Disable insecure sms option
This commit is contained in:
commit
2fec819b48
@ -32,7 +32,7 @@ public class TransportOptions {
|
||||
private final Context context;
|
||||
private final List<TransportOption> enabledTransports;
|
||||
|
||||
private Type defaultTransportType = Type.SMS;
|
||||
private Type defaultTransportType = Type.TEXTSECURE;
|
||||
private Optional<Integer> defaultSubscriptionId = Optional.absent();
|
||||
private Optional<TransportOption> 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<TransportOption> initializeAvailableTransports(boolean isMediaMessage) {
|
||||
List<TransportOption> 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),
|
||||
|
@ -1330,7 +1330,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);
|
||||
|
||||
@ -1340,6 +1342,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
if (isSecureText || isPushGroupConversation()) sendButton.setDefaultTransport(Type.TEXTSECURE);
|
||||
else sendButton.setDefaultTransport(Type.SMS);
|
||||
}
|
||||
*/
|
||||
|
||||
calculateCharactersRemaining();
|
||||
supportInvalidateOptionsMenu();
|
||||
|
Loading…
Reference in New Issue
Block a user