fixed conference naming for joined people not in your contact list

This commit is contained in:
Daniel Gultsch 2017-08-15 12:56:32 +02:00
parent 65d4f50b02
commit dd5e321247
1 changed files with 8 additions and 2 deletions

View File

@ -656,8 +656,14 @@ public class MucOptions {
Contact contact = user.getContact(); Contact contact = user.getContact();
if (contact != null && !contact.getDisplayName().isEmpty()) { if (contact != null && !contact.getDisplayName().isEmpty()) {
builder.append(contact.getDisplayName().split("\\s+")[0]); builder.append(contact.getDisplayName().split("\\s+")[0]);
} else if (user.getName() != null){ } else {
builder.append(user.getName()); final String name = user.getName();
final Jid jid = user.getRealJid();
if (name != null){
builder.append(name.split("\\s+")[0]);
} else if (jid != null) {
builder.append(jid.getLocalpart());
}
} }
} }
return builder.toString(); return builder.toString();