diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-02-08 23:25:29 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-02-08 23:25:29 +0100 |
commit | 960e20123cf663ee4375acb5c385d43554f1b7e7 (patch) | |
tree | 1d133973afe7d50383da240291a3d14636a96a97 /src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java | |
parent | e3fd52b661e423e65e9436d380e434920e91f6aa (diff) |
brought back 'moderated' config in advanced mode
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/MucConfiguration.java | 47 |
1 files changed, 34 insertions, 13 deletions
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); } } |