Skip to content

feat(chat): handle the creator speaker rule and keep unknown speaker rules closed - #1636

Merged
bmc08gt merged 3 commits into
code/cashfrom
chore/flipcash2-d082b0a3
Sep 30, 2026
Merged

bmc08gt merged 3 commits into
code/cashfrom
chore/flipcash2-d082b0a3

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Handles the creator speaker rule from flipcash2-client-protocol 0.14.1, keeps unrecognised speaker rules closed, and gates the composer on both.

Pins flipcash2-client-protocol 0.14.1 (code-payments/flipcash2-client-protocol#21), now on Maven Central.

Mapping (a91ae4628)

  • ChatRuleRequirement.Creator maps both ways and persists with the cached chat.
  • An unset or unknown speaker rule used to be dropped (else -> null + mapNotNull), which read as "no requirement" and left the chat open. It now maps to ChatRuleRequirement.UnsupportedSpeakerRule, which is persisted and throws on encode.

Pin (1913b9ad3): flipcash2-client-protocol 0.14.1.

Gating (c53eff2b0)

  • Creator: only the chat creator can post, replies included. Anyone can react, copy or report. A chat with no known creator is treated as unmet, and staff don't bypass it. The composer shows "Only the creator can send messages".
  • UnsupportedSpeakerRule: unmet for everyone, staff included. The composer shows "Update Flipcash to send messages".
  • Neither blocks reactions. resolveSpeakerBlock returns the unmet requirement together with whether reactions are blocked, so a chat that pairs Creator with Staff still turns reactions off.
  • ChatViewModel reads rules and creator from chat metadata for every chat type. The DM behaviour from fix(chat): apply speaker rules to DMs so the welcome chat is read-only #1638 is unchanged.

Rebased onto code/cash after #1634, #1635 and #1638 merged, so the diff is these three commits only.

GroupAccessTest, ChatViewModelStateTest, MessageCapabilityTest and SpeakerGateBarScreenshotTest pass against the local client checkout.

@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@github-actions github-actions Bot added type: feature New functionality area: network gRPC, connectivity, API, exchange rates area: build-system Gradle, convention plugins, build-logic and removed type: feature New functionality labels Sep 30, 2026
@bmc08gt
bmc08gt marked this pull request as ready for review September 30, 2026 18:09
@bmc08gt
bmc08gt changed the base branch from chore/flipcash2-df1cb04e to code/cash September 30, 2026 18:09
…aker rules closed

Adds ChatRuleRequirement.Creator (SpeakerRules.creator, speaker-only) and
ChatRuleRequirement.UnsupportedSpeakerRule for an unset or future speaker
case, which was previously dropped and so read as no requirement. Both
block posting only (blocksReactions is false). Unsupported is decode-only
and rejected on encode; both persist.
Creator is met only when the viewer's account id equals the chat's
creator; a chat with no creator id stays closed and staff get no bypass.
UnsupportedSpeakerRule is unmet for everyone. Either replaces the composer
and withholds Reply. Reactions are withheld only when an unmet rule has
blocksReactions, so creator alone leaves them on and creator plus staff
turns them off. SpeakerGateBar gets copy for both.
@bmc08gt
bmc08gt force-pushed the chore/flipcash2-d082b0a3 branch from cbc22e9 to c53eff2 Compare September 30, 2026 18:14
@github-actions github-actions Bot added the type: feature New functionality label Sep 30, 2026
@bmc08gt
bmc08gt merged commit 7e30f31 into code/cash Sep 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: network gRPC, connectivity, API, exchange rates type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant