Skip to content

feat(chat): send shares from other apps to chosen conversations - #1757

Merged
bmc08gt merged 6 commits into
code/cashfrom
feat/chat-share-target
Oct 12, 2026
Merged

bmc08gt merged 6 commits into
code/cashfrom
feat/chat-share-target

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Flipcash now accepts ACTION_SEND and ACTION_SEND_MULTIPLE shares 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. PendingChatShares flags the share as incoming before the images finish copying, and MainRoot waits 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:

  • Up to 5 chats (ShareRecipients.limit on iOS) and 10 images (ShareInput.maxImages); extra images are dropped with an "Only the first 10 images are sent." notice.
  • Each image is its own message, with the text as the caption of the last; a text-only share is one text message.
  • Progress reads "Sending X of Y", each failed chat gets its own line, and Retry resends only the chats that failed.

Sends go through the same calls the chat screen uses: ChatCoordinator.sendMessage for text, and ChatMediaUploads.stage plus ChatCoordinator.sendMedia for photos. Whether to encrypt is still decided in OutgoingEncryption by E2eePolicy.shouldEncrypt(chat). Images are staged separately for each chat, so an upload sealed for one chat is never reused for another. ChatShareGatewayTest covers both cases against the real DmOutgoingEncryption.

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

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.
@bmc08gt bmc08gt changed the title feat(chat): accept shares from other apps into a chosen conversation feat(chat): send shares from other apps to chosen conversations Oct 12, 2026
@bmc08gt
bmc08gt merged commit 7a1eee1 into code/cash Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant