diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java index c5c69577d..69de24d58 100644 --- a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java +++ b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java @@ -62,7 +62,7 @@ public final class MucDetailsContextMenuHelper { MenuItem giveOwnerPrivileges = menu.findItem(R.id.give_owner_privileges); MenuItem removeOwnerPrivileges = menu.findItem(R.id.revoke_owner_privileges); MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room); - MenuItem managePermisisons = menu.findItem(R.id.manage_permissions); + MenuItem managePermissions = menu.findItem(R.id.manage_permissions); removeFromRoom.setTitle(isGroupChat ? R.string.remove_from_room : R.string.remove_from_channel); MenuItem banFromConference = menu.findItem(R.id.ban_from_conference); banFromConference.setTitle(isGroupChat ? R.string.ban_from_conference : R.string.ban_from_channel); @@ -85,13 +85,15 @@ public final class MucDetailsContextMenuHelper { boolean managePermissionsVisible = false; if ((self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) && self.getAffiliation().outranks(user.getAffiliation())) || self.getAffiliation() == MucOptions.Affiliation.OWNER) { if (advancedMode) { - managePermissionsVisible = true; if (!user.getAffiliation().ranks(MucOptions.Affiliation.MEMBER)) { + managePermissionsVisible = true; giveMembership.setVisible(true); } else if (user.getAffiliation() == MucOptions.Affiliation.MEMBER) { + managePermissionsVisible = true; removeMembership.setVisible(true); } if (!Config.DISABLE_BAN) { + managePermissionsVisible = true; banFromConference.setVisible(true); } } else { @@ -103,23 +105,25 @@ public final class MucDetailsContextMenuHelper { } if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { if (isGroupChat || advancedMode || user.getAffiliation() == MucOptions.Affiliation.OWNER) { - managePermissionsVisible = true; if (!user.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { + managePermissionsVisible = true; giveOwnerPrivileges.setVisible(true); } else if (user.getAffiliation() == MucOptions.Affiliation.OWNER) { + managePermissionsVisible = true; removeOwnerPrivileges.setVisible(true); } } if (!isGroupChat || advancedMode || user.getAffiliation() == MucOptions.Affiliation.ADMIN) { - managePermissionsVisible = true; if (!user.getAffiliation().ranks(MucOptions.Affiliation.ADMIN)) { + managePermissionsVisible = true; giveAdminPrivileges.setVisible(true); } else if (user.getAffiliation() == MucOptions.Affiliation.ADMIN) { + managePermissionsVisible = true; removeAdminPrivileges.setVisible(true); } } } - managePermisisons.setVisible(managePermissionsVisible); + managePermissions.setVisible(managePermissionsVisible); sendPrivateMessage.setVisible(true); sendPrivateMessage.setEnabled(mucOptions.allowPm()); } else { |