Repository navigation
fix(chat): apply speaker rules to DMs so the Flipcash chat is read-only - #929
Merged
Merged
Conversation
The Flipcash welcome chat is a tip DM that carries a never speaker rule in its metadata, but ConversationScreen only evaluated rules for groups, so a DM always got the ordinary composer. gate and gateVerdicts now read the rules of any chat on screen. A DM participant is always a member, so a never rule resolves to readOnly(.never) and draws the "Only Flipcash can send messages" pill. A DM without rules stays open. Reply and reactions were already gated for every chat type through ConversationController.gateConversation; only the composer was missing. Mirrors code-android-app#1638.
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.
The Flipcash welcome chat still showed the composer. It is a tip DM (type 2) with the
flipcashaccount, and its metadata carries aneverspeaker rule.ConversationScreenonly evaluated rules whentype == .group, so every DM got.open.gateandgateVerdictsnow read the rules of whatever chat is on screen. A DM participant is always a member (ConversationStore.isMember), so aneverrule resolves toreadOnly(.never)and draws the "Only Flipcash can send messages" pill. A DM without rules stays open.Reply and reactions already applied rules to every chat type through
ConversationController.gateConversation. Only the composer was missing.The contract still documents
Metadata.rulesas "Only supported for group chats", which is how the group-only check got in.Android fixed the same gap in code-payments/code-android-app#1638.