From 960e20123cf663ee4375acb5c385d43554f1b7e7 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 8 Feb 2019 23:25:29 +0100 Subject: brought back 'moderated' config in advanced mode --- .../pixart/messenger/ui/util/MucConfiguration.java | 47 ++++++++++++++++------ 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java') diff --git a/src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java b/src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java index 4630a5a93..6c3235d5a 100644 --- a/src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java +++ b/src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java @@ -22,7 +22,7 @@ public class MucConfiguration { this.options = options; } - public static MucConfiguration get(Context context, MucOptions mucOptions) { + public static MucConfiguration get(Context context, boolean advanced, MucOptions mucOptions) { if (mucOptions.isPrivateAndNonAnonymous()) { String[] names = new String[]{ context.getString(R.string.allow_participants_to_edit_subject), @@ -38,18 +38,39 @@ public class MucConfiguration { }; return new MucConfiguration(R.string.conference_options, names, values, options); } else { - String[] names = new String[]{ - context.getString(R.string.non_anonymous), - context.getString(R.string.allow_participants_to_edit_subject), - }; - boolean[] values = new boolean[]{ - mucOptions.nonanonymous(), - mucOptions.participantsCanChangeSubject() - }; - final Option[] options = new Option[]{ - new Option("muc#roomconfig_whois", "anyone", "moderators"), - new Option("muc#roomconfig_changesubject") - }; + final String[] names; + final boolean[] values; + final Option[] options; + if (advanced) { + names = new String[]{ + context.getString(R.string.non_anonymous), + context.getString(R.string.allow_participants_to_edit_subject), + context.getString(R.string.moderated) + }; + values = new boolean[]{ + mucOptions.nonanonymous(), + mucOptions.participantsCanChangeSubject(), + mucOptions.moderated() + }; + options = new Option[]{ + new Option("muc#roomconfig_whois", "anyone", "moderators"), + new Option("muc#roomconfig_changesubject"), + new Option("muc#roomconfig_moderatedroom") + }; + } else { + names = new String[]{ + context.getString(R.string.non_anonymous), + context.getString(R.string.allow_participants_to_edit_subject), + }; + values = new boolean[]{ + mucOptions.nonanonymous(), + mucOptions.participantsCanChangeSubject() + }; + options = new Option[]{ + new Option("muc#roomconfig_whois", "anyone", "moderators"), + new Option("muc#roomconfig_changesubject") + }; + } return new MucConfiguration(R.string.channel_options, names, values, options); } } -- cgit v1.2.3