Skip to content

fix(chat): gate cash-card taps on membership and the thank-you on the composer - #1545

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/cash-link-member-gate
Sep 23, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/cash-link-member-gate

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Two guards on cash cards in chat, mirroring what iOS added on feat/cash-link-claim-reply.

No thank-you when the viewer can't post. Android recorded every tap for a "Thanks for the cash!" reply, including from a reader outside the group or in a deactivated DM, where the reply is a send the server rejects. The tap is now recorded only when the composer is live (!isAnonymous && !replacesComposer). Android has no read-only-member state for speaker rules yet: the composer shows for any member. So "composer is live" is the same test iOS runs at its .open gate.

Non-members can't claim from the card. An eligible non-member reads the group sharp and can see a cash card. Tapping it now shows "Join to Collect" / "Join this chat to collect cash sent in it." and does not open the link, so it never reaches openCashLink and records no reply. The copy matches iOS and is provisional there too. Members, including one whose join checkmark is still showing, claim as before.

To make that possible, MessageBubble no longer opens a cash link itself. ChatAction.CashLinkOpened now carries the URL, and MessengerScreen opens it only when State.cashCardTap says Collect.

This guards the card tap only. The URL is still in the message text, and a non-member can copy it and claim it anywhere. Whether the server should refuse that claim is a separate question.

Tests: ChatViewModelStateTest covers cashCardTap for members, DMs, eligible/blocked/unknown non-members, a deactivated DM, and the join-checkmark frame.

… composer

A non-member reading a group could tap a cash card and claim it, and any
reader was recorded for a "Thanks for the cash!" reply even when they had
no composer to post it from, so the reply went to a send the server
rejects.

The card now hands its URL to the chat instead of opening it, and
State.cashCardTap decides: a viewer outside the group gets a "Join to
Collect" sheet and the link stays closed; a member opens it, and the tap
is recorded for a reply only when the composer is live. Mirrors iOS
(code-ios-app feat/cash-link-claim-reply).
@bmc08gt bmc08gt self-assigned this Sep 23, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Sep 23, 2026
@bmc08gt
bmc08gt merged commit ac2792f into code/cash Sep 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant