From 76d0f45b9bbe622664323fb48f3bcb4035c7cea0 Mon Sep 17 00:00:00 2001 From: Rhodey Orbits Date: Fri, 20 Mar 2015 17:56:12 -0700 Subject: [PATCH] append invite link to message draft instead of overwrite it. Fixes #2583 // FREEBIE --- src/org/thoughtcrime/securesms/ConversationActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index ece8d4462e..69e7d040cc 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -343,9 +343,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private void handleInviteLink() { try { + if (!TextUtils.isEmpty(composeText.getText()) && + !composeText.getText().toString().endsWith(" ")) + { + composeText.append(" "); + } boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean(); - if (a) composeText.setText(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/zhrzvk6")); - else composeText.setText(getString(R.string.ConversationActivity_install_textsecure, "http://sgnl.link/1yKYqoN")); + if (a) composeText.append(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/zhrzvk6")); + else composeText.append(getString(R.string.ConversationActivity_install_textsecure, "http://sgnl.link/1yKYqoN")); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); }