mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 12:15:50 +01:00
Sort contacts without names after contacts with names.
This commit is contained in:
committed by
Greyson Parrelli
parent
dc70bfabaf
commit
a3aed96757
@@ -418,6 +418,15 @@ public class Recipient {
|
||||
else return Optional.fromNullable(getName(context)).or(getSmsAddress()).or("");
|
||||
}
|
||||
|
||||
/**
|
||||
* False iff it {@link #getDisplayName} would fall back to e164, email or unknown.
|
||||
*/
|
||||
public boolean hasAUserSetDisplayName(@NonNull Context context) {
|
||||
return !TextUtils.isEmpty(getName(context)) ||
|
||||
!TextUtils.isEmpty(getProfileName().toString()) ||
|
||||
!TextUtils.isEmpty(getDisplayUsername());
|
||||
}
|
||||
|
||||
public @NonNull String getDisplayName(@NonNull Context context) {
|
||||
return Util.getFirstNonEmpty(getName(context),
|
||||
getProfileName().toString(),
|
||||
|
||||
Reference in New Issue
Block a user