forked from mirror/monocles_chat
show self contact with display name
(cherry picked from commit 9db0808306
)
This commit is contained in:
parent
31d98ddb40
commit
81a7d0c33f
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,8 @@ import android.text.TextUtils;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -132,6 +134,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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue