append invite link to message draft instead of overwrite it.

Fixes #2583
// FREEBIE
This commit is contained in:
Rhodey Orbits 2015-03-20 17:56:12 -07:00 committed by Moxie Marlinspike
parent 3a19ac432b
commit 76d0f45b9b

View File

@ -343,9 +343,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
private void handleInviteLink() { private void handleInviteLink() {
try { try {
if (!TextUtils.isEmpty(composeText.getText()) &&
!composeText.getText().toString().endsWith(" "))
{
composeText.append(" ");
}
boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean(); boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean();
if (a) composeText.setText(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/zhrzvk6")); if (a) composeText.append(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/zhrzvk6"));
else composeText.setText(getString(R.string.ConversationActivity_install_textsecure, "http://sgnl.link/1yKYqoN")); else composeText.append(getString(R.string.ConversationActivity_install_textsecure, "http://sgnl.link/1yKYqoN"));
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
throw new AssertionError(e); throw new AssertionError(e);
} }