Repository navigation
fix(chat): stop a viewer outside a group from replying to its messages - #1540
Merged
bmc08gt merged 1 commit intoSep 23, 2026
Merged
Conversation
With #1537 an eligible non-member reads a group's transcript under the Join gate, but resolveCapabilities looks only at the message, so every other person's message offered Reply. Swiping or picking Reply set replyingTo behind the gate, and the composer later opened quoting it once the viewer joined. A former member's own messages offered Edit and Delete the same way. resolveCapabilities takes canPost, and a viewer who cannot post keeps only Copy and Report. The transcript mapping re-runs when the viewer joins or leaves, and the selection bar narrows its set with readOnly() if they left after the row was mapped, as it already does with the edit and delete windows.
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.
Stacked on #1537, which lets an eligible non-member read a group's transcript under the Join gate.
resolveCapabilitieslooks only at the message, so once a non-member had messages to see, every other person's message offered Reply, both by swipe and from the selection bar. The reply went intoreplyingTobehind the gate, where the viewer couldn't see it, and the composer then opened already quoting that message once they joined. A former member's own messages offered Edit and Delete the same way.resolveCapabilitiesnow takescanPost. A viewer who can't post keeps only Copy and Report:canPostis!isOutsideGroup, so a group whose membership isn't known yet also counts as can't post. Capabilities are resolved when the transcript is mapped, so the mapping now re-runs when membership changes. Without that, a new joiner wouldn't get Reply back until the next page loaded. The selection bar also appliesreadOnly()when it opens, the same way it re-applies the edit and delete windows, in case the viewer left after the message was mapped.Report stays available to non-members. I haven't confirmed that the server accepts a report from someone outside the chat.