From dd5e3212471d0e0c8aa2dcbae13adeb4289de388 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 15 Aug 2017 12:56:32 +0200 Subject: [PATCH] fixed conference naming for joined people not in your contact list --- .../eu/siacs/conversations/entities/MucOptions.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 2ce183054..6e98db605 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -656,8 +656,14 @@ public class MucOptions { Contact contact = user.getContact(); if (contact != null && !contact.getDisplayName().isEmpty()) { builder.append(contact.getDisplayName().split("\\s+")[0]); - } else if (user.getName() != null){ - builder.append(user.getName()); + } else { + 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();