diff options
author | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-08 00:23:26 +0100 |
---|---|---|
committer | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-08 00:23:26 +0100 |
commit | 061de5205e198eac51cf54af5fd9b2e4faebe4d2 (patch) | |
tree | 212209090a386d846a2b257d313b946cc58c263a /src/main/java/eu | |
parent | cff9a937f26960bf8f851ea469ec991aa36d4a5a (diff) |
some clean ups for affiliation change context menu
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index 5272c9226..2185c3afd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -245,6 +245,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers MenuItem giveAdminPrivileges = menu.findItem(R.id.give_admin_privileges); MenuItem removeAdminPrivileges = menu.findItem(R.id.remove_admin_privileges); MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room); + MenuItem banFromConference = menu.findItem(R.id.ban_from_conference); startConversation.setVisible(true); if (self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) && self.getAffiliation().outranks(user.getAffiliation())) { @@ -254,13 +255,15 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } else { removeMembership.setVisible(true); } + banFromConference.setVisible(true); + } else { + removeFromRoom.setVisible(true); } if (user.getAffiliation() != MucOptions.Affiliation.ADMIN) { giveAdminPrivileges.setVisible(true); } else { removeAdminPrivileges.setVisible(true); } - removeFromRoom.setVisible(true); } } @@ -289,6 +292,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers case R.id.remove_from_room: removeFromRoom(mSelectedUser); return true; + case R.id.ban_from_conference: + xmppConnectionService.changeAffiliationInConference(mConversation,mSelectedUser.getJid(), MucOptions.Affiliation.OUTCAST,this); + return true; default: return super.onContextItemSelected(item); } @@ -299,7 +305,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers xmppConnectionService.changeAffiliationInConference(mConversation,user.getJid(), MucOptions.Affiliation.NONE,this); } else { AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.ban_user_from_conference); + builder.setTitle(R.string.ban_from_conference); builder.setMessage(getString(R.string.removing_from_public_conference,user.getName())); builder.setNegativeButton(R.string.cancel,null); builder.setPositiveButton(R.string.ban_now,new DialogInterface.OnClickListener() { |