17 lines
503 B
Java
17 lines
503 B
Java
|
package org.mercury_im.messenger.core.util;
|
||
|
|
||
|
import org.mercury_im.messenger.persistence.model.ContactModel;
|
||
|
|
||
|
public class ContactNameUtil {
|
||
|
|
||
|
public static String displayableNameFrom(ContactModel contactModel) {
|
||
|
if (contactModel.getRosterName() != null) {
|
||
|
return contactModel.getRosterName();
|
||
|
}
|
||
|
if (contactModel.getEntity() != null) {
|
||
|
return contactModel.getEntity().getJid().getLocalpart().asUnescapedString();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|