Repository navigation
feat(chat): send shares from other apps to chosen conversations - #1757
Merged
Merged
Conversation
Register MainActivity for ACTION_SEND / ACTION_SEND_MULTIPLE (text and images). Images are copied into the capture directory on receipt, a chat picker opens, and the chosen conversation stages the images as photo chips and appends the text to the composer. Nothing is sent. A share is held in PendingChatShares and claimed once by the chat; media is skipped when the chat does not accept it.
The media gate read chatId from state, which ChatFound sets after the share is applied, so images were dropped. Pass the routed chat id instead.
…s in place The picker drew an empty list before the feed emitted and took only the first emission. It now shows a progress indicator until the list is known, keeps following the feed, and merges later lists into the order already on screen so rows do not move under a tap.
The launch route was chosen before the shared images finished copying, so the chat list rendered first and the picker was pushed over it. The share is now flagged as incoming when the intent arrives and the launch route waits for it (bounded at 3s), then places the picker straight over the start screen.
The picker now sends directly, as the iOS share extension does: up to 5 chats, up to 10 images, the message as the caption of the last photo, progress per chat, and a retry that goes only to the chats that failed. Sends reuse the chat screen's own text and photo paths, so OutgoingEncryption decides sealing per chat. The composer staging path is removed.
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.
Flipcash now accepts
ACTION_SENDandACTION_SEND_MULTIPLEshares of text and images from other apps and sends them from a "Send to" picker, matching the iOS share extension.A share launch opens directly on the picker, on cold and warm start.
PendingChatSharesflags the share as incoming before the images finish copying, andMainRootwaits for that (bounded at 3 s) before building the launch graph, so the chat list no longer renders first. Closing the picker lands on the normal start screen.The picker follows iOS on behaviour and limits:
ShareRecipients.limiton iOS) and 10 images (ShareInput.maxImages); extra images are dropped with an "Only the first 10 images are sent." notice.Sends go through the same calls the chat screen uses:
ChatCoordinator.sendMessagefor text, andChatMediaUploads.stageplusChatCoordinator.sendMediafor photos. Whether to encrypt is still decided inOutgoingEncryptionbyE2eePolicy.shouldEncrypt(chat). Images are staged separately for each chat, so an upload sealed for one chat is never reused for another.ChatShareGatewayTestcovers both cases against the realDmOutgoingEncryption.The earlier path that staged the share into the chat's composer is removed.
Direct-share shortcuts still resolve to no chat; the shortcut id mapping is a stub.
iOS counterpart: code-payments/code-ios-app#1041