Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-2916 and OF-2917 Add the option to control MUC history preservation #2621

Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ private void processConfigurationForm(@Nonnull final DataForm completedForm, @No
room.setPublicRoom( parseFirstValueAsBoolean( field, true ) );
}

field = completedForm.getField("muc#roomconfig_preservehistondel");
guusdk marked this conversation as resolved.
Show resolved Hide resolved
if (field != null) {
final boolean newValue = parseFirstValueAsBoolean(field, true);
room.setPreserveHistOnRoomDeletionEnabled(newValue);
}

field = completedForm.getField("muc#roomconfig_persistentroom");
if (field != null) {
boolean isPersistent = parseFirstValueAsBoolean( field, true );
Expand Down Expand Up @@ -570,6 +576,10 @@ private Element generateProbeResult(Locale preferredLocale) {
LocaleUtils.getLocalizedString("muc.form.conf.owner_enablelogging", preferredLocale),
Type.boolean_type);

configurationForm.addField("muc#roomconfig_preservehistondel",
LocaleUtils.getLocalizedString("muc.form.conf.owner_preservehistondel", preferredLocale),
Type.boolean_type);

configurationForm.addField("x-muc#roomconfig_reservednick",
LocaleUtils.getLocalizedString("muc.form.conf.owner_reservednick", preferredLocale),
Type.boolean_type);
Expand Down Expand Up @@ -663,6 +673,10 @@ private Element generateProbeResult(Locale preferredLocale) {
field.clearValues();
field.addValue((room.isLogEnabled() ? "1" : "0"));

field = configurationForm.getField("muc#roomconfig_preservehistondel");
field.clearValues();
field.addValue((room.isPreserveHistOnRoomDeletionEnabled() ? "1" : "0"));

field = configurationForm.getField("x-muc#roomconfig_reservednick");
field.clearValues();
field.addValue((room.isLoginRestrictedToNickname() ? "1" : "0"));
Expand Down