From d61e5094de86c617ea71c861175e9af3cf5aa5b0 Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Sat, 26 Dec 2015 12:48:58 +0100 Subject: [PATCH] remove newlines in text-only group messages Closes #4963 //FREEBIE --- .../securesms/mms/OutgoingMediaMessage.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/mms/OutgoingMediaMessage.java b/src/org/thoughtcrime/securesms/mms/OutgoingMediaMessage.java index af07384638..c47ef5663e 100644 --- a/src/org/thoughtcrime/securesms/mms/OutgoingMediaMessage.java +++ b/src/org/thoughtcrime/securesms/mms/OutgoingMediaMessage.java @@ -29,7 +29,7 @@ public class OutgoingMediaMessage { public OutgoingMediaMessage(Recipients recipients, SlideDeck slideDeck, String message, long sentTimeMillis, int distributionType) { this(recipients, - TextUtils.isEmpty(message) ? slideDeck.getBody() : slideDeck.getBody() + "\n\n" + message, + buildMessage(slideDeck, message), slideDeck.asAttachments(), sentTimeMillis, distributionType); @@ -71,4 +71,13 @@ public class OutgoingMediaMessage { return sentTimeMillis; } + private static String buildMessage(SlideDeck slideDeck, String message) { + if (!TextUtils.isEmpty(message) && !TextUtils.isEmpty(slideDeck.getBody())) { + return slideDeck.getBody() + "\n\n" + message; + } else if (!TextUtils.isEmpty(message)) { + return message; + } else { + return slideDeck.getBody(); + } + } }