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/utils | |
parent | 3041cc74cefb4a25f4d1af7109fcb141ec3293d8 (diff) |
Added method to get body from message if hasMeCommand and harmonized extraction of fileextension (FS#38)
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/UIHelper.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 3d091e39..e9dbba31 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -17,7 +17,6 @@ import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.Presence; -import eu.siacs.conversations.entities.Presences; import eu.siacs.conversations.entities.Transferable; import eu.siacs.conversations.xmpp.jid.Jid; @@ -179,9 +178,8 @@ public class UIHelper { return new Pair<>(getFileDescriptionString(context,message),true); } } else { - if (message.getBody().startsWith(Message.ME_COMMAND)) { - return new Pair<>(message.getBody().replaceAll("^" + Message.ME_COMMAND, - UIHelper.getMessageDisplayName(message) + " "), false); + if (message.hasMeCommand()) { + return new Pair<>(message.getBodyReplacedMeCommand(UIHelper.getMessageDisplayName(message)), false); } else if (GeoHelper.isGeoUri(message.getBody())) { if (message.getStatus() == Message.STATUS_RECEIVED) { return new Pair<>(context.getString(R.string.received_location), true); |