diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java index 7467cdcc78..c089feed6b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -49,6 +49,8 @@ import androidx.annotation.DimenRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.annimon.stream.Stream; + +import org.session.libsession.messaging.contacts.Contact; import org.session.libsession.messaging.jobs.AttachmentDownloadJob; import org.session.libsession.messaging.jobs.JobQueue; import org.session.libsession.messaging.open_groups.OpenGroupAPIV2; @@ -889,7 +891,15 @@ public class ConversationItem extends LinearLayout @SuppressLint("SetTextI18n") private void setGroupMessageStatus(MessageRecord messageRecord, Recipient recipient) { if (groupThread && !messageRecord.isOutgoing()) { - String displayName = recipient.toShortString(); + String sessionID = recipient.getAddress().serialize(); + Contact contact = DatabaseFactory.getSessionContactDatabase(context).getContactWithSessionID(sessionID); + String displayName; + if (contact != null) { + Contact.ContactContext context = (this.conversationRecipient.isOpenGroupRecipient()) ? Contact.ContactContext.OPEN_GROUP : Contact.ContactContext.REGULAR; + displayName = contact.displayName(context); + } else { + displayName = sessionID; + } this.groupSender.setText(displayName); diff --git a/libsession/src/main/java/org/session/libsession/messaging/contacts/Contact.kt b/libsession/src/main/java/org/session/libsession/messaging/contacts/Contact.kt index ea15d11f03..43b1532b65 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/contacts/Contact.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/contacts/Contact.kt @@ -44,7 +44,7 @@ class Contact(val sessionID: String) { // In open groups, where it's more likely that multiple users have the same name, // we display a bit of the Session ID after a user's display name for added context. this.name?.let { - return "${this.name}${this.sessionID.takeLast(8)}" + return "${this.name} (...${this.sessionID.takeLast(8)})" } return null }