From 7368df94f72d2b4587188ddc7ad97e2f04c290df Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 20 Apr 2018 17:12:47 +0200 Subject: [PATCH] provide access to show qr code from context menu in start conversation activity --- .../ui/StartConversationActivity.java | 17 +++++++++-------- src/main/res/menu/contact_context.xml | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index ab0a1112d..5ee20b8f4 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -345,11 +345,6 @@ public class StartConversationActivity extends XmppActivity implements XmppConne switchToConversation(conversation); } - protected void openConversationForContact() { - int position = contact_context_id; - openConversationForContact(position); - } - protected void openConversationForBookmark() { openConversationForBookmark(conference_context_id); } @@ -397,6 +392,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne switchToContactDetails(contact); } + protected void showQrForContact() { + int position = contact_context_id; + Contact contact = (Contact) contacts.get(position); + showQrCode("xmpp:"+contact.getJid().asBareJid().toEscapedString()); + } + protected void toggleContactBlock() { final int position = contact_context_id; BlockContactDialog.show(this, (Contact) contacts.get(position)); @@ -1047,12 +1048,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne return true; } switch (item.getItemId()) { - case R.id.context_start_conversation: - activity.openConversationForContact(); - break; case R.id.context_contact_details: activity.openDetailsForContact(); break; + case R.id.context_show_qr: + activity.showQrForContact(); + break; case R.id.context_contact_block_unblock: activity.toggleContactBlock(); break; diff --git a/src/main/res/menu/contact_context.xml b/src/main/res/menu/contact_context.xml index 223c7ece0..e6da36f45 100644 --- a/src/main/res/menu/contact_context.xml +++ b/src/main/res/menu/contact_context.xml @@ -1,12 +1,12 @@ - + - +