From d9d40ecb4297a7ade4205d6dca411c01aa728663 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 24 Jun 2018 21:34:47 +0200 Subject: WIP: set room avatar and slight redesign of group details *show jid in group details (in advanced mode) --- .../java/de/pixart/messenger/entities/MucOptions.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/entities') diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index a6968b66f..eb5629b2e 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java @@ -373,7 +373,7 @@ public class MucOptions { this.self = new User(this, createJoinJid(getProposedNick())); } - public boolean updateConfiguration(List features, Data data) { + public boolean updateConfiguration(List features, String name, Data data) { updateFeatures(features); updateFormData(data == null ? new Data() : data); Field allowPmField = this.form.getFieldByName("muc#roomconfig_allowpm"); @@ -382,6 +382,7 @@ public class MucOptions { changed |= conversation.setAttribute(Conversation.ATTRIBUTE_MEMBERS_ONLY, this.hasFeature("muc_membersonly")); changed |= conversation.setAttribute(Conversation.ATTRIBUTE_MODERATED, this.hasFeature("muc_moderated")); changed |= conversation.setAttribute(Conversation.ATTRIBUTE_NON_ANONYMOUS, this.hasFeature("muc_nonanonymous")); + changed |= setName(name); return changed; } @@ -402,6 +403,10 @@ public class MucOptions { return this.features.contains(feature); } + public boolean hasVCards() { + return hasFeature("vcard-temp"); + } + public boolean canInvite() { Field field = this.form.getFieldByName("muc#roomconfig_allowinvites"); return !membersOnly() || self.getRole().ranks(Role.MODERATOR) || (field != null && "1".equals(field.getValue())); @@ -688,6 +693,14 @@ public class MucOptions { return this.conversation.getAttribute("subject"); } + private boolean setName(String name) { + return this.conversation.setAttribute("muc_name", name); + } + + public String getName() { + return this.conversation.getAttribute("muc_name"); + } + public List getFallbackUsersFromCryptoTargets() { List users = new ArrayList<>(); for (Jid jid : conversation.getAcceptedCryptoTargets()) { -- cgit v1.2.3