From f12c2426281737443ccea8d32c7f7bc1452480c7 Mon Sep 17 00:00:00 2001 From: kosyak Date: Mon, 30 Oct 2023 21:31:54 +0100 Subject: [PATCH] note to self as separate context menu item --- .../conversations/ui/StartConversationActivity.java | 12 ++++++++++++ src/main/res/menu/start_conversation.xml | 6 ++++++ src/main/res/values/strings.xml | 1 + 3 files changed, 19 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 99d3676da..2907575b3 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -730,6 +730,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne AccountUtils.showHideMenuItems(menu); MenuItem menuHideOffline = menu.findItem(R.id.action_hide_offline); MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); + MenuItem noteToSelf = menu.findItem(R.id.action_note_to_self); qrCodeScanMenuItem.setVisible(isCameraFeatureAvailable()); if (QuickConversationsService.isQuicksy()) { menuHideOffline.setVisible(false); @@ -737,6 +738,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne menuHideOffline.setVisible(true); menuHideOffline.setChecked(this.mHideOfflineContacts); } + + if (xmppConnectionService.getAccounts().size() != 1) { + noteToSelf.setVisible(false); + } + mMenuSearchView = menu.findItem(R.id.action_search); mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener); View mSearchView = mMenuSearchView.getActionView(); @@ -781,6 +787,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne filter(mSearchEditText.getText().toString()); } invalidateOptionsMenu(); + case R.id.action_note_to_self: + final List accounts = xmppConnectionService.getAccounts(); + if (accounts.size() == 1) { + final Contact self = new Contact(accounts.get(0).getSelfContact()); + openConversationForContact(self); + } } return super.onOptionsItemSelected(item); } diff --git a/src/main/res/menu/start_conversation.xml b/src/main/res/menu/start_conversation.xml index ffbcc0c44..942bd665f 100644 --- a/src/main/res/menu/start_conversation.xml +++ b/src/main/res/menu/start_conversation.xml @@ -14,6 +14,12 @@ android:icon="?attr/icon_scan_qr_code" app:showAsAction="always"/> + + Avatar has been published! Sending %s Offering %s + Note to self Hide offline %s is typing… %s has stopped typing