Merge pull request #1289 from kriztan/patch-2

show contact details in conference details ...
This commit is contained in:
Daniel Gultsch 2015-07-20 13:16:19 +02:00
commit 2d2da11bfa
2 changed files with 10 additions and 1 deletions

View File

@ -274,6 +274,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
name = user.getJid().toBareJid().toString(); name = user.getJid().toBareJid().toString();
} }
menu.setHeaderTitle(name); menu.setHeaderTitle(name);
MenuItem showContactDetails = menu.findItem(R.id.action_contact_details);
MenuItem startConversation = menu.findItem(R.id.start_conversation); MenuItem startConversation = menu.findItem(R.id.start_conversation);
MenuItem giveMembership = menu.findItem(R.id.give_membership); MenuItem giveMembership = menu.findItem(R.id.give_membership);
MenuItem removeMembership = menu.findItem(R.id.remove_membership); MenuItem removeMembership = menu.findItem(R.id.remove_membership);
@ -282,6 +283,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room); MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room);
MenuItem banFromConference = menu.findItem(R.id.ban_from_conference); MenuItem banFromConference = menu.findItem(R.id.ban_from_conference);
startConversation.setVisible(true); startConversation.setVisible(true);
showContactDetails.setVisible(true);
if (self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) && if (self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) &&
self.getAffiliation().outranks(user.getAffiliation())) { self.getAffiliation().outranks(user.getAffiliation())) {
if (mAdvancedMode) { if (mAdvancedMode) {
@ -309,6 +311,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
@Override @Override
public boolean onContextItemSelected(MenuItem item) { public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_contact_details:
switchToContactDetails(mSelectedUser.getContact());
return true;
case R.id.start_conversation: case R.id.start_conversation:
startConversation(mSelectedUser); startConversation(mSelectedUser);
return true; return true;

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <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 <item
android:id="@+id/start_conversation" android:id="@+id/start_conversation"
android:title="@string/start_conversation" android:title="@string/start_conversation"