mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 03:52:06 +01:00
[muc] Add support for muc#roomconfig_enablelogging to MucConfigFormManager
This commit is contained in:
parent
90c7dc4390
commit
1d498efd46
1 changed files with 25 additions and 0 deletions
|
@ -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<Jid> 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
|
||||
|
|
Loading…
Reference in a new issue