Send to the conversation picked in the share sheet - #7672
Open
Xant3s wants to merge 1 commit into
Open
Conversation
Picking a conversation in the Direct Share row did nothing with that choice: the app still opened the account picker, then the room picker, so the shortcut saved no steps over sharing to Element X itself. The system names the chosen shortcut in Intent.EXTRA_SHORTCUT_ID, which nothing read. The share now carries that id, and the session it belongs to resolves the room it was built for, so the share goes straight there. The id format moves to the push api module, since building and matching it is no longer something only the notification code does. The extra is absent when the app is opened from a launcher shortcut rather than the Direct Share row, and an id that matches no logged in session resolves to nothing, so both fall back to the pickers as before. Part of element-hq#3835 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
Contributor
PR Checks
|
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
The Direct Share row of the system share sheet already offered conversations, but picking one did nothing with that choice: the app still showed the account picker (when there is more than one account), then the room picker. The system names the chosen shortcut in
Intent.EXTRA_SHORTCUT_ID, which nothing read. The share now carries that id, and the session it belongs to resolves the room it was built for.Follows #7574, which declared the
<share-target>that makes the row appear.Motivation and context
Part of #3835
Tests
Unit tests cover the id format (
ConversationShortcutIdTest), the id reachingShareIntentDatafor both plain text and uris (DefaultShareIntentHandlerTest), and the presenter sending without a selection — including the case where the shortcut belongs to a different account than the one handling the share (SharePresenterTest).Manually:
The message is sent to that room, with no account or room picker.
Tested devices
Checklist