Repository navigation
feat(chat): handle the creator speaker rule and keep unknown speaker rules closed - #926
Merged
Merged
Conversation
bmc08gt
force-pushed
the
chore/flipcash2-d082b0a3
branch
from
September 30, 2026 18:24
d5922b8 to
6ef38a0
Compare
Add ConversationSpeakerRule.creator (chat.v1 SpeakerRules.creator = 4): only Metadata.creator may send. Staff get no bypass. The gate now takes the chat's creator and compares it with the viewer's user id; an unknown creator fails closed. A speaker rule with an unset or unrecognized kind now maps to .unsupported instead of being dropped (which opened the composer). It blocks posting for everyone and the panel asks the user to update. It has no wire form. A viewer who fails a speaker rule loses Reply; copy and report stay. Reactions are blocked only by a reaction-blocking rule (never, minimum balance, staff) or an unmet listener rule, so creator-only and unsupported leave them on; this replaces the all-or-nothing canSpeak flag from the speaker-rule UI. Bump Database.schemaVersion to 45: rule JSON gains cases, and rows stored by an earlier build dropped creator and unreadable rules, which read as an open composer.
bmc08gt
force-pushed
the
chore/flipcash2-d082b0a3
branch
from
September 30, 2026 18:28
6ef38a0 to
f61deb6
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). Rebased onto
mainafter #919, #922 and #925 merged; the pin bump comes first because the.creatorarm only compiles against 0.14.1.ConversationSpeakerRule.creatorround-trips.conversationGatetakes the conversation's creator:.creatoris met only when the viewer is the creator, and an unknown creator fails closed. Staff don't bypass it.compactMap, leaving the chat open. It now maps to.unsupported, which is closed for everyone including staff..creatorand.unsupportedrender as fix(chat): apply speaker rules to replies and reactions, and match the never composer design #922's glass pill (renamedReadOnlyPillGlass), reading "Only the creator can send messages" and "Update Flipcash to send messages". Staff and minimum balance keep the card.ConversationGate.allowsReactionsnarrows that to Never, MinimumBalance, Staff and listener rules, so.creatoror.unsupportedalone leave reactions, copy and report available. Creator paired with an unmet Staff rule still blocks reactions.access(isMember:gate:)now carries both answers (canReact,canPost), replacing the separatecanSpeakclosure. Reply followscanPost.Database.schemaVersion44 → 45 so stores written before this, which dropped creator-only and unreadable rules, rebuild instead of showing an open composer../Scripts/build.shpasses; 198 tests across the gate, share-widget gating, capability, mapping, membership, push-routing, new-group, typing and reaction suites pass.