mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-17 21:47:28 +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 Context context;
|
||||||
private final List<TransportOption> enabledTransports;
|
private final List<TransportOption> enabledTransports;
|
||||||
|
|
||||||
private Type defaultTransportType = Type.SMS;
|
private Type defaultTransportType = Type.TEXTSECURE;
|
||||||
private Optional<Integer> defaultSubscriptionId = Optional.absent();
|
private Optional<Integer> defaultSubscriptionId = Optional.absent();
|
||||||
private Optional<TransportOption> selectedOption = Optional.absent();
|
private Optional<TransportOption> selectedOption = Optional.absent();
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ public class TransportOptions {
|
|||||||
if (selectedOption.isPresent() && !isEnabled(selectedOption.get())) {
|
if (selectedOption.isPresent() && !isEnabled(selectedOption.get())) {
|
||||||
setSelectedTransport(null);
|
setSelectedTransport(null);
|
||||||
} else {
|
} else {
|
||||||
this.defaultTransportType = Type.SMS;
|
this.defaultTransportType = Type.TEXTSECURE;
|
||||||
this.defaultSubscriptionId = Optional.absent();
|
this.defaultSubscriptionId = Optional.absent();
|
||||||
|
|
||||||
notifyTransportChangeListeners();
|
notifyTransportChangeListeners();
|
||||||
@ -149,16 +149,6 @@ public class TransportOptions {
|
|||||||
private List<TransportOption> initializeAvailableTransports(boolean isMediaMessage) {
|
private List<TransportOption> initializeAvailableTransports(boolean isMediaMessage) {
|
||||||
List<TransportOption> results = new LinkedList<>();
|
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,
|
results.add(new TransportOption(Type.TEXTSECURE, R.drawable.ic_send_push_white_24dp,
|
||||||
context.getResources().getColor(R.color.textsecure_primary),
|
context.getResources().getColor(R.color.textsecure_primary),
|
||||||
context.getString(R.string.ConversationActivity_transport_signal),
|
context.getString(R.string.ConversationActivity_transport_signal),
|
||||||
|
@ -1330,7 +1330,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
boolean isMediaMessage = recipient.isMmsGroupRecipient() || attachmentManager.isAttachmentPresent();
|
boolean isMediaMessage = recipient.isMmsGroupRecipient() || attachmentManager.isAttachmentPresent();
|
||||||
|
|
||||||
sendButton.resetAvailableTransports(isMediaMessage);
|
sendButton.resetAvailableTransports(isMediaMessage);
|
||||||
|
sendButton.setDefaultTransport(Type.TEXTSECURE);
|
||||||
|
|
||||||
|
/* Loki - We don't support SMS
|
||||||
if (!isSecureText && !isPushGroupConversation()) sendButton.disableTransport(Type.TEXTSECURE);
|
if (!isSecureText && !isPushGroupConversation()) sendButton.disableTransport(Type.TEXTSECURE);
|
||||||
if (recipient.isPushGroupRecipient()) sendButton.disableTransport(Type.SMS);
|
if (recipient.isPushGroupRecipient()) sendButton.disableTransport(Type.SMS);
|
||||||
|
|
||||||
@ -1340,6 +1342,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
if (isSecureText || isPushGroupConversation()) sendButton.setDefaultTransport(Type.TEXTSECURE);
|
if (isSecureText || isPushGroupConversation()) sendButton.setDefaultTransport(Type.TEXTSECURE);
|
||||||
else sendButton.setDefaultTransport(Type.SMS);
|
else sendButton.setDefaultTransport(Type.SMS);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
calculateCharactersRemaining();
|
calculateCharactersRemaining();
|
||||||
supportInvalidateOptionsMenu();
|
supportInvalidateOptionsMenu();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user