From 7bcf173866c37c7ba62af96d21134823e67bb6b9 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 3 Aug 2017 10:55:14 +0200 Subject: [PATCH] remove all whitespaces in emoji only messages --- src/main/java/eu/siacs/conversations/entities/Message.java | 2 +- .../java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index aba5c6004..f882b7e1d 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -669,7 +669,7 @@ public class Message extends AbstractEntity { } public boolean bodyIsOnlyEmojis() { - return EmojiManager.isOnlyEmojis(body.trim()); + return EmojiManager.isOnlyEmojis(body.replaceAll("\\s","")); } public FileParams getFileParams() { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index a954b11cc..2dc8bbbcd 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -793,7 +793,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie if (GeoHelper.isGeoUri(message.getBody())) { displayLocationMessage(viewHolder,message); } else if (message.bodyIsOnlyEmojis()) { - displayEmojiMessage(viewHolder, message.getBody().trim()); + displayEmojiMessage(viewHolder, message.getBody().replaceAll("\\s","")); } else if (message.treatAsDownloadable()) { try { URL url = new URL(message.getBody());