Skip to content

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

Merged
bmc08gt merged 2 commits into
mainfrom
chore/flipcash2-d082b0a3
Sep 30, 2026
Merged

bmc08gt merged 2 commits into
mainfrom
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). Rebased onto main after #919, #922 and #925 merged; the pin bump comes first because the .creator arm only compiles against 0.14.1.

  • ConversationSpeakerRule.creator round-trips. conversationGate takes the conversation's creator: .creator is met only when the viewer is the creator, and an unknown creator fails closed. Staff don't bypass it.
  • An unset speaker rule used to be dropped by compactMap, leaving the chat open. It now maps to .unsupported, which is closed for everyone including staff.
  • .creator and .unsupported render as fix(chat): apply speaker rules to replies and reactions, and match the never composer design #922's glass pill (renamed ReadOnlyPillGlass), reading "Only the creator can send messages" and "Update Flipcash to send messages". Staff and minimum balance keep the card.
  • fix(chat): apply speaker rules to replies and reactions, and match the never composer design #922 withheld reactions whenever a speaker rule was unmet. ConversationGate.allowsReactions narrows that to Never, MinimumBalance, Staff and listener rules, so .creator or .unsupported alone 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 separate canSpeak closure. Reply follows canPost.
  • Database.schemaVersion 44 → 45 so stores written before this, which dropped creator-only and unreadable rules, rebuild instead of showing an open composer.

./Scripts/build.sh passes; 198 tests across the gate, share-widget gating, capability, mapping, membership, push-routing, new-group, typing and reaction suites pass.

@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@bmc08gt
bmc08gt marked this pull request as ready for review September 30, 2026 18:13
@bmc08gt
bmc08gt changed the base branch from chore/flipcash2-df1cb04e to main September 30, 2026 18:17
@bmc08gt
bmc08gt force-pushed the chore/flipcash2-d082b0a3 branch from d5922b8 to 6ef38a0 Compare September 30, 2026 18:24
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
bmc08gt force-pushed the chore/flipcash2-d082b0a3 branch from 6ef38a0 to f61deb6 Compare September 30, 2026 18:28
@bmc08gt
bmc08gt merged commit f3dad03 into main Sep 30, 2026
1 check failed
bmc08gt added a commit that referenced this pull request Oct 1, 2026
…938)

FlipcashAPI requires flipcash2 exactly 0.14.1 since #925/#926, but the
workspace Package.resolved still pinned 0.12.0. Xcode Cloud resolves from
the committed file without updating it, so Deploy Flipcash has failed at
package resolution since 5e1fd73.
@bmc08gt
bmc08gt deleted the chore/flipcash2-d082b0a3 branch October 5, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant