fixed MucOptions.getName()

This commit is contained in:
Daniel Gultsch 2018-06-27 17:17:44 +02:00
parent d6a40a839a
commit db03470eb4

View file

@ -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<ServiceDiscoveryResult.Identity> 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<User> getFallbackUsersFromCryptoTargets() {