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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user