aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-06-24 21:34:47 +0200
committerChristian Schneppe <christian@pix-art.de>2018-06-29 21:55:43 +0200
commitd9d40ecb4297a7ade4205d6dca411c01aa728663 (patch)
tree2853511ab2432799cbb9d2ab1a7d736e424c8e63 /src/main/java/de/pixart/messenger/entities
parent6633eedbb75d5fa85186c053aa7797b5b5458fc6 (diff)
WIP: set room avatar and slight redesign of group details
*show jid in group details (in advanced mode)
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/MucOptions.java15
1 files changed, 14 insertions, 1 deletions
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<String> features, Data data) {
+ public boolean updateConfiguration(List<String> 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<User> getFallbackUsersFromCryptoTargets() {
List<User> users = new ArrayList<>();
for (Jid jid : conversation.getAcceptedCryptoTargets()) {