Fallback to SMS app for invitations
Fixes #6369 Closes #6400 // FREEBIE
This commit is contained in:
parent
742b54f32d
commit
0f548a431b
1 changed files with 14 additions and 2 deletions
|
@ -644,9 +644,21 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
|
|
||||||
private void handleInviteLink() {
|
private void handleInviteLink() {
|
||||||
try {
|
try {
|
||||||
|
String inviteText;
|
||||||
|
|
||||||
boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean();
|
boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean();
|
||||||
if (a) composeText.appendInvite(getString(R.string.ConversationActivity_lets_switch_to_signal, "https://sgnl.link/1LoIMUl"));
|
if (a) inviteText = getString(R.string.ConversationActivity_lets_switch_to_signal, "https://sgnl.link/1LoIMUl");
|
||||||
else composeText.appendInvite(getString(R.string.ConversationActivity_lets_use_this_to_chat, "https://sgnl.link/1MF56H1"));
|
else inviteText = getString(R.string.ConversationActivity_lets_use_this_to_chat, "https://sgnl.link/1MF56H1");
|
||||||
|
|
||||||
|
if (isDefaultSms) {
|
||||||
|
composeText.appendInvite(inviteText);
|
||||||
|
} else {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
||||||
|
intent.setData(Uri.parse("smsto:" + recipients.getPrimaryRecipient().getNumber()));
|
||||||
|
intent.putExtra("sms_body", inviteText);
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, inviteText);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue