From 2dc02828ae302ceb8f2ff94cc3c1735918ba54c8 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 10 Dec 2024 02:11:53 -0500 Subject: [PATCH] Implement direct share (cherry picked from commit 4a5068b790dae7aa1c5c8e46693be6ffafef34c4) --- src/cheogram/res/xml/shortcuts.xml | 7 +++++++ src/main/AndroidManifest.xml | 1 + .../eu/siacs/conversations/services/ShortcutService.java | 3 +++ .../java/eu/siacs/conversations/ui/ShareWithActivity.java | 8 ++++++++ 4 files changed, 19 insertions(+) create mode 100644 src/cheogram/res/xml/shortcuts.xml diff --git a/src/cheogram/res/xml/shortcuts.xml b/src/cheogram/res/xml/shortcuts.xml new file mode 100644 index 000000000..6431baeb3 --- /dev/null +++ b/src/cheogram/res/xml/shortcuts.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 03069f52d..385b55518 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -193,6 +193,7 @@ + uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); this.share.uris = uris == null ? new ArrayList<>() : uris; } + final var shortcutId = intent.getStringExtra(Intent.EXTRA_SHORTCUT_ID); + if (shortcutId != null) { + final var index = shortcutId.indexOf('#'); + if (index >= 0) { + this.share.account = shortcutId.substring(0, index); + this.share.contact = shortcutId.substring(index+1); + } + } if (xmppConnectionServiceBound) { xmppConnectionService.populateWithOrderedConversations( mConversations, this.share.uris.isEmpty(), false);