From 857c761c68b17f137040a6b59329a6d0a8c50ff3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 7 Mar 2017 09:22:42 +0100 Subject: [PATCH] fixed sender label for empty conversations --- .../java/eu/siacs/conversations/entities/Conversation.java | 1 + .../siacs/conversations/ui/adapter/ConversationAdapter.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 2f3989dd8..0290c9710 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -455,6 +455,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/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index 154b68b50..b793f9a1f 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -115,9 +115,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); } }