From 9db08083064cc30d2157aefee2ac274bf57267b3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 20 Jan 2021 08:15:06 +0100 Subject: [PATCH] show self contact with display name --- .../java/eu/siacs/conversations/entities/Contact.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java index ad0bfcf83..5ca575459 100644 --- a/src/main/java/eu/siacs/conversations/entities/Contact.java +++ b/src/main/java/eu/siacs/conversations/entities/Contact.java @@ -7,6 +7,8 @@ import android.net.Uri; import androidx.annotation.NonNull; import android.text.TextUtils; +import com.google.common.base.Strings; + import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -131,6 +133,12 @@ public class Contact implements ListItem, Blockable { } public String getDisplayName() { + if (isSelf()) { + final String displayName = account.getDisplayName(); + if (!Strings.isNullOrEmpty(displayName)) { + return displayName; + } + } if (Config.X509_VERIFICATION && !TextUtils.isEmpty(this.commonName)) { return this.commonName; } else if (!TextUtils.isEmpty(this.systemName)) {