mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-06 07:46:55 +00:00
Fix crash when signal messages disabled in group conversation
Fixes #6419 Closes #6803
This commit is contained in:
parent
c4991e857d
commit
34424a9b3e
@ -56,6 +56,13 @@
|
|||||||
|
|
||||||
<include layout="@layout/conversation_input_panel"/>
|
<include layout="@layout/conversation_input_panel"/>
|
||||||
|
|
||||||
|
<Button android:id="@+id/register_button"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="20dp"
|
||||||
|
android:text="@string/conversation_activity__enable_signal_messages"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<Button android:id="@+id/unblock_button"
|
<Button android:id="@+id/unblock_button"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -1316,6 +1316,7 @@
|
|||||||
<string name="Permissions_continue">Continue</string>
|
<string name="Permissions_continue">Continue</string>
|
||||||
<string name="Permissions_not_now">Not now</string>
|
<string name="Permissions_not_now">Not now</string>
|
||||||
<string name="ConversationListActivity_signal_needs_contacts_permission_in_order_to_search_your_contacts_but_it_has_been_permanently_denied">Signal needs Contacts permission in order to search your contacts, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Contacts\".</string>
|
<string name="ConversationListActivity_signal_needs_contacts_permission_in_order_to_search_your_contacts_but_it_has_been_permanently_denied">Signal needs Contacts permission in order to search your contacts, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Contacts\".</string>
|
||||||
|
<string name="conversation_activity__enable_signal_messages">ENABLE SIGNAL MESSAGES</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- EOF -->
|
<!-- EOF -->
|
||||||
|
@ -225,6 +225,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private ConversationFragment fragment;
|
private ConversationFragment fragment;
|
||||||
private Button unblockButton;
|
private Button unblockButton;
|
||||||
private Button makeDefaultSmsButton;
|
private Button makeDefaultSmsButton;
|
||||||
|
private Button registerButton;
|
||||||
private InputAwareLayout container;
|
private InputAwareLayout container;
|
||||||
private View composePanel;
|
private View composePanel;
|
||||||
protected Stub<ReminderView> reminderView;
|
protected Stub<ReminderView> reminderView;
|
||||||
@ -677,6 +678,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
startActivityForResult(intent, SMS_DEFAULT);
|
startActivityForResult(intent, SMS_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleRegisterForSignal() {
|
||||||
|
Intent intent = new Intent(this, RegistrationActivity.class);
|
||||||
|
intent.putExtra("cancel_button", true);
|
||||||
|
intent.putExtra("master_secret", masterSecret);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
private void handleInviteLink() {
|
private void handleInviteLink() {
|
||||||
try {
|
try {
|
||||||
String inviteText;
|
String inviteText;
|
||||||
@ -959,11 +967,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
sendButton.resetAvailableTransports(isMediaMessage);
|
sendButton.resetAvailableTransports(isMediaMessage);
|
||||||
|
|
||||||
if (!isSecureText) 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);
|
||||||
|
|
||||||
if (isSecureText) 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();
|
||||||
@ -1213,6 +1221,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub);
|
emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub);
|
||||||
unblockButton = ViewUtil.findById(this, R.id.unblock_button);
|
unblockButton = ViewUtil.findById(this, R.id.unblock_button);
|
||||||
makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button);
|
makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button);
|
||||||
|
registerButton = ViewUtil.findById(this, R.id.register_button);
|
||||||
composePanel = ViewUtil.findById(this, R.id.bottom_panel);
|
composePanel = ViewUtil.findById(this, R.id.bottom_panel);
|
||||||
container = ViewUtil.findById(this, R.id.layout_container);
|
container = ViewUtil.findById(this, R.id.layout_container);
|
||||||
reminderView = ViewUtil.findStubById(this, R.id.reminder_stub);
|
reminderView = ViewUtil.findStubById(this, R.id.reminder_stub);
|
||||||
@ -1260,6 +1269,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
titleView.setOnBackClickedListener(view -> super.onBackPressed());
|
titleView.setOnBackClickedListener(view -> super.onBackPressed());
|
||||||
unblockButton.setOnClickListener(v -> handleUnblock());
|
unblockButton.setOnClickListener(v -> handleUnblock());
|
||||||
makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms());
|
makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms());
|
||||||
|
registerButton.setOnClickListener(v -> handleRegisterForSignal());
|
||||||
|
|
||||||
composeText.setOnKeyListener(composeKeyPressedListener);
|
composeText.setOnKeyListener(composeKeyPressedListener);
|
||||||
composeText.addTextChangedListener(composeKeyPressedListener);
|
composeText.addTextChangedListener(composeKeyPressedListener);
|
||||||
@ -1476,14 +1486,22 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
unblockButton.setVisibility(View.VISIBLE);
|
unblockButton.setVisibility(View.VISIBLE);
|
||||||
composePanel.setVisibility(View.GONE);
|
composePanel.setVisibility(View.GONE);
|
||||||
makeDefaultSmsButton.setVisibility(View.GONE);
|
makeDefaultSmsButton.setVisibility(View.GONE);
|
||||||
|
registerButton.setVisibility(View.GONE);
|
||||||
|
} else if (!isSecureText && isPushGroupConversation()) {
|
||||||
|
unblockButton.setVisibility(View.GONE);
|
||||||
|
composePanel.setVisibility(View.GONE);
|
||||||
|
makeDefaultSmsButton.setVisibility(View.GONE);
|
||||||
|
registerButton.setVisibility(View.VISIBLE);
|
||||||
} else if (!isSecureText && !isDefaultSms) {
|
} else if (!isSecureText && !isDefaultSms) {
|
||||||
unblockButton.setVisibility(View.GONE);
|
unblockButton.setVisibility(View.GONE);
|
||||||
composePanel.setVisibility(View.GONE);
|
composePanel.setVisibility(View.GONE);
|
||||||
makeDefaultSmsButton.setVisibility(View.VISIBLE);
|
makeDefaultSmsButton.setVisibility(View.VISIBLE);
|
||||||
|
registerButton.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
composePanel.setVisibility(View.VISIBLE);
|
composePanel.setVisibility(View.VISIBLE);
|
||||||
unblockButton.setVisibility(View.GONE);
|
unblockButton.setVisibility(View.GONE);
|
||||||
makeDefaultSmsButton.setVisibility(View.GONE);
|
makeDefaultSmsButton.setVisibility(View.GONE);
|
||||||
|
registerButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user