fix: revoke chat access as soon as a user leaves the chat group

The BM chat context implements golem15.chat's LiveMembership, so every
participant check also requires chat-group membership: a removed user
loses # ogólny, their DMs, uploads, subscriptions and chat:message
delivery at once instead of after the next participant sync.
This commit is contained in:
2026-10-26 19:33:52 +01:00
parent a840d0ad02
commit 8b81295458
2 changed files with 10 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ func TestChatContext(t *testing.T) {
if _, err := c.HasMember(ctx, 13); err == nil {
t.Error("HasMember with a failing check returned no error")
}
if !c.RequireLiveMembership() {
t.Error("RequireLiveMembership = false, want true: removal from the chat group must revoke access at once")
}
if !c.CanActFor(ctx, 7, 7) || c.CanActFor(ctx, 7, 8) {
t.Error("CanActFor is not self-only")
}