diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java index 7eff69fa0..9f2778e9c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java @@ -93,6 +93,11 @@ public class MucConfigFormManager { */ public static final String MUC_ROOMCONFIG_ROOMNAME = "muc#roomconfig_roomname"; + /** + * The constant String {@value}. + */ + public static final String MUC_ROOMCONFIG_ENABLE_PUBLIC_LOGGING = "muc#roomconfig_enablelogging"; + private final MultiUserChat multiUserChat; private final FillableForm answerForm; private final List owners; @@ -331,6 +336,26 @@ public class MucConfigFormManager { return this; } + public boolean supportsPublicLogging() { + return answerForm.hasField(MUC_ROOMCONFIG_ENABLE_PUBLIC_LOGGING); + } + + public MucConfigFormManager setPublicLogging(boolean enabled) throws MucConfigurationNotSupportedException { + if (!supportsPublicLogging()) { + throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_ENABLE_PUBLIC_LOGGING); + } + answerForm.setAnswer(MUC_ROOMCONFIG_ENABLE_PUBLIC_LOGGING, enabled); + return this; + } + + public MucConfigFormManager enablePublicLogging() throws MucConfigurationNotSupportedException { + return setPublicLogging(true); + } + + public MucConfigFormManager disablPublicLogging() throws MucConfigurationNotSupportedException { + return setPublicLogging(false); + } + /** * Set the room secret, aka the room password. If set and enabled, the password is required to * join the room. Note that this does only set it by does not enable password protection. Use