2019-11-18 23:51:27 +01:00
|
|
|
package org.mercury_im.domain.data.util;
|
2019-09-11 01:40:32 +02:00
|
|
|
|
2019-12-09 15:49:59 +01:00
|
|
|
import org.mercury_im.messenger.entity.contact.Peer;
|
2019-09-11 01:40:32 +02:00
|
|
|
|
|
|
|
public class ContactNameUtil {
|
|
|
|
|
2019-12-09 15:49:59 +01:00
|
|
|
public static String displayableNameFrom(Peer contact) {
|
|
|
|
if (contact == null) {
|
2019-10-28 14:56:56 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-12-09 15:49:59 +01:00
|
|
|
if (contact.getName() != null) {
|
|
|
|
return contact.getName();
|
2019-09-11 01:40:32 +02:00
|
|
|
}
|
2019-10-28 14:56:56 +01:00
|
|
|
|
2019-12-09 15:49:59 +01:00
|
|
|
return contact.getAddress();
|
2019-10-28 14:56:56 +01:00
|
|
|
}
|
2019-09-11 01:40:32 +02:00
|
|
|
}
|