diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-07-20 14:24:59 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-07-20 14:24:59 +0200 |
commit | 9c91b9036aa57c610c26b4cdf52ee295eaa0dc95 (patch) | |
tree | 91b7fee3280cd1bb76e23d5fe159848a79c9c2b1 /src | |
parent | 2d2da11bfae712f6248bd0c0cd943dacd07d6201 (diff) |
don't show 'show contact details' context menu item when contact isn not in roster
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java | 11 | ||||
-rw-r--r-- | src/main/res/menu/muc_details_context.xml | 50 |
2 files changed, 33 insertions, 28 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index 614a6648..3d15d3e1 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -283,7 +283,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room); MenuItem banFromConference = menu.findItem(R.id.ban_from_conference); startConversation.setVisible(true); - showContactDetails.setVisible(true); + if (contact != null) { + showContactDetails.setVisible(true); + } if (self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) && self.getAffiliation().outranks(user.getAffiliation())) { if (mAdvancedMode) { @@ -305,14 +307,17 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } } - super.onCreateContextMenu(menu,v,menuInfo); + super.onCreateContextMenu(menu, v, menuInfo); } @Override public boolean onContextItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_contact_details: - switchToContactDetails(mSelectedUser.getContact()); + Contact contact = mSelectedUser.getContact(); + if (contact != null) { + switchToContactDetails(contact); + } return true; case R.id.start_conversation: startConversation(mSelectedUser); diff --git a/src/main/res/menu/muc_details_context.xml b/src/main/res/menu/muc_details_context.xml index 592e44af..6fddb23e 100644 --- a/src/main/res/menu/muc_details_context.xml +++ b/src/main/res/menu/muc_details_context.xml @@ -1,36 +1,36 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item - android:id="@+id/action_contact_details" - android:title="@string/action_contact_details" - android:visible="false" /> - <item android:id="@+id/start_conversation" android:title="@string/start_conversation" - android:visible="false" /> - <item - android:id="@+id/give_membership" + android:visible="false"/> + <item + android:id="@+id/action_contact_details" + android:title="@string/action_contact_details" + android:visible="false"/> + <item + android:id="@+id/give_membership" android:title="@string/grant_membership" - android:visible="false" /> - <item - android:id="@+id/give_admin_privileges" + android:visible="false"/> + <item + android:id="@+id/give_admin_privileges" android:title="@string/grant_admin_privileges" - android:visible="false"/> - <item - android:id="@+id/remove_admin_privileges" + android:visible="false"/> + <item + android:id="@+id/remove_admin_privileges" android:title="@string/remove_admin_privileges" - android:visible="false"/> + android:visible="false"/> - <item - android:id="@+id/remove_membership" - android:title="@string/remove_membership" - android:visible="false"/> - <item - android:id="@+id/ban_from_conference" - android:title="@string/ban_from_conference" - android:visible="false" /> - <item - android:id="@+id/remove_from_room" + <item + android:id="@+id/remove_membership" + android:title="@string/remove_membership" + android:visible="false"/> + <item + android:id="@+id/ban_from_conference" + android:title="@string/ban_from_conference" + android:visible="false"/> + <item + android:id="@+id/remove_from_room" android:title="@string/remove_from_room" - android:visible="false"/> + android:visible="false"/> </menu> |