diff options
author | lookshe <github@lookshe.org> | 2016-03-12 02:28:22 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-03-12 02:28:22 +0100 |
commit | bf49abe865ca746fad452a759f3792ca322e1fce (patch) | |
tree | 89c57470ffb1bd4cf12364ccab8814156e0fa3f8 /src/main/java/eu/siacs/conversations/ui/adapter | |
parent | 3041cc74cefb4a25f4d1af7109fcb141ec3293d8 (diff) |
Added method to get body from message if hasMeCommand and harmonized extraction of fileextension (FS#38)
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 6 |
1 files changed, 3 insertions, 3 deletions
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 b130df9b..b5d1272c 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -281,9 +281,9 @@ public class MessageAdapter extends ArrayAdapter<Message> { if (message.getBody() != null) { final String nick = UIHelper.getMessageDisplayName(message); String body; - try { - body = message.getBody().replaceAll("^" + Message.ME_COMMAND, nick + " "); - } catch (ArrayIndexOutOfBoundsException e) { + if (message.hasMeCommand()) { + body = message.getBodyReplacedMeCommand(nick); + } else { body = message.getBody(); } final SpannableString formattedBody = new SpannableString(body); |