aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-01-30 20:41:18 +0100
committerChristian Schneppe <christian@pix-art.de>2018-01-30 20:41:18 +0100
commit7c36cc935c249aad57b86bf81e221115ef7ef572 (patch)
tree3121dfb7a2700512c5a7b232dd2e55a0ed233173 /src/main/java/de/pixart/messenger
parentaf8b48b3400b5eac6ddb22b1efde19b10dac3183 (diff)
optimized /me behavior
fixes #133
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java2
-rw-r--r--src/main/java/de/pixart/messenger/utils/UIHelper.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 9f4bcade6..a2b75853d 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -71,7 +71,7 @@ public class Message extends AbstractEntity {
public static final String ERROR_MESSAGE = "errorMsg";
public static final String READ_BY_MARKERS = "readByMarkers";
public static final String MARKABLE = "markable";
- public static final String ME_COMMAND = "/me ";
+ public static final String ME_COMMAND = "/me";
public boolean markable = false;
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index a68958ed5..d62192170 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -437,7 +437,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
public boolean onLongClick(View v) {
final String body = mEditMessage.getText().toString();
if (body.length() == 0) {
- mEditMessage.getText().insert(0, "/me ");
+ mEditMessage.getText().insert(0, Message.ME_COMMAND + " ");
}
return true;
}
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index a332ac967..b005bf9e2 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -492,7 +492,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
SpannableStringBuilder body = message.getMergedBody();
boolean hasMeCommand = message.hasMeCommand();
if (hasMeCommand) {
- body = body.replace(0, Message.ME_COMMAND.length(), nick + " ");
+ body = body.replace(0, Message.ME_COMMAND.length(), nick);
}
if (body.length() > Config.MAX_DISPLAY_MESSAGE_CHARS) {
body = new SpannableStringBuilder(body, 0, Config.MAX_DISPLAY_MESSAGE_CHARS);
diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java
index d3e44999f..451ec3aec 100644
--- a/src/main/java/de/pixart/messenger/utils/UIHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java
@@ -286,7 +286,7 @@ public class UIHelper {
final String body = message.getBody();
if (body.startsWith(Message.ME_COMMAND)) {
return new Pair<>(body.replaceAll("^" + Message.ME_COMMAND,
- UIHelper.getMessageDisplayName(message) + " "), false);
+ UIHelper.getMessageDisplayName(message)), false);
} else if (message.isGeoUri()) {
if (message.getStatus() == Message.STATUS_RECEIVED) {
return new Pair<>(context.getString(R.string.received_location), true);