From db03470eb4c9fdc7f9f959d5f76f7237f77284d7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 27 Jun 2018 17:17:44 +0200 Subject: [PATCH] fixed MucOptions.getName() --- .../java/eu/siacs/conversations/entities/MucOptions.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 51333437c..37cae98e5 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -384,12 +384,12 @@ public class MucOptions { String name; Field roomConfigName = getRoomInfoForm().getFieldByName("muc#roomconfig_roomname"); if (roomConfigName != null) { - Log.d(Config.LOGTAG,"value of room config name "+roomConfigName.getValue()); name = roomConfigName.getValue(); } else { List identities = serviceDiscoveryResult.getIdentities(); String identityName = identities.size() > 0 ? identities.get(0).getName() : null; - if (!conversation.getJid().getEscapedLocal().equals(identityName)) { + final Jid jid = conversation.getJid(); + if (identityName != null && !identityName.equals(jid == null ? null : jid.getEscapedLocal())) { name = identityName; } else { name = null; @@ -715,8 +715,7 @@ public class MucOptions { } public String getName() { - String mucName = this.conversation.getAttribute("muc_name"); - return conversation.getJid().getEscapedLocal().equals(mucName) ? null : mucName; + return this.conversation.getAttribute("muc_name"); } private List getFallbackUsersFromCryptoTargets() {