From 297870eed0559ac7aec0dfd977dc9a8e381dcd3b Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 9 Mar 2017 20:14:45 +0100 Subject: fixed sender label for empty conversations --- src/main/java/de/pixart/messenger/entities/Conversation.java | 1 + src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 24b45e158..e4e138ec2 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -471,6 +471,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl public Message getLatestMessage() { if (this.messages.size() == 0) { Message message = new Message(this, "", Message.ENCRYPTION_NONE); + message.setType(Message.TYPE_STATUS); message.setTime(getCreated()); return message; } else { diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java index 097c3b4e8..755fb4406 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java @@ -148,9 +148,11 @@ public class ConversationAdapter extends ArrayAdapter { } else { mSenderName.setVisibility(View.GONE); } - } else { + } else if (message.getType() != Message.TYPE_STATUS) { mSenderName.setVisibility(View.VISIBLE); mSenderName.setText(activity.getString(R.string.me)+':'); + } else { + mSenderName.setVisibility(View.GONE); } } -- cgit v1.2.3