feat(chat): handle the creator speaker rule and keep unknown speaker rules closed - #1636
Merged
Merged
Conversation
bmc08gt
marked this pull request as ready for review
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
force-pushed
the
chore/flipcash2-d082b0a3
branch
from
September 30, 2026 18:14
cbc22e9 to
c53eff2
Compare
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.
Handles the
creatorspeaker 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.Creatormaps both ways and persists with the cached chat.else -> null+mapNotNull), which read as "no requirement" and left the chat open. It now maps toChatRuleRequirement.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".resolveSpeakerBlockreturns the unmet requirement together with whether reactions are blocked, so a chat that pairsCreatorwithStaffstill turns reactions off.ChatViewModelreads 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/cashafter #1634, #1635 and #1638 merged, so the diff is these three commits only.GroupAccessTest,ChatViewModelStateTest,MessageCapabilityTestandSpeakerGateBarScreenshotTestpass against the local client checkout.