From d5ae2f4b4183d1159d633cb4fc91e42c16d3a61c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 6 Sep 2023 13:47:30 +0200 Subject: [PATCH] look at roomconfig_changesubject and roominfo_changesubject fixes #90 --- src/main/java/eu/siacs/conversations/entities/MucOptions.java | 4 +++- .../eu/siacs/conversations/ui/ConferenceDetailsActivity.java | 3 ++- 2 files changed, 5 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 cc1c358de..c408d147f 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -170,7 +170,9 @@ public class MucOptions { } public boolean participantsCanChangeSubject() { - final Field field = getRoomInfoForm().getFieldByName("muc#roominfo_changesubject"); + final Field configField = getRoomInfoForm().getFieldByName("muc#roomconfig_changesubject"); + final Field infoField = getRoomInfoForm().getFieldByName("muc#roominfo_changesubject"); + final Field field = configField != null ? configField : infoField; return field != null && "1".equals(field.getValue()); } diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index fb716044c..f5fb9c7f5 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -137,8 +137,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers builder.setMultiChoiceItems(configuration.names, values, (dialog, which, isChecked) -> values[which] = isChecked); builder.setNegativeButton(R.string.cancel, null); builder.setPositiveButton(R.string.confirm, (dialog, which) -> { - Bundle options = configuration.toBundle(values); + final Bundle options = configuration.toBundle(values); options.putString("muc#roomconfig_persistentroom", "1"); + options.putString("{http://prosody.im/protocol/muc}roomconfig_allowmemberinvites", options.getString("muc#roomconfig_allowinvites")); xmppConnectionService.pushConferenceConfiguration(mConversation, options, ConferenceDetailsActivity.this);