Use Set because Tuple doesn't allow - operations

This commit is contained in:
Eric Eastwood 2024-06-05 11:03:06 -05:00
parent 1fc1b58ba2
commit 6a6cdc61f3
2 changed files with 2 additions and 2 deletions

View file

@ -50,7 +50,7 @@ class Membership:
KNOCK: Final = "knock"
LEAVE: Final = "leave"
BAN: Final = "ban"
LIST: Final = (INVITE, JOIN, KNOCK, LEAVE, BAN)
LIST: Final = {INVITE, JOIN, KNOCK, LEAVE, BAN}
class PresenceState:

View file

@ -57,7 +57,7 @@ def filter_membership_for_sync(*, membership: str, user_id: str, sender: str) ->
# Everything except `Membership.LEAVE` because we want everything that's *still*
# relevant to the user. There are few more things to include in the sync response
# (newly_left) but those are handled separately.
membership in (Membership.LIST - Membership.LEAVE)
membership in (Membership.LIST - {Membership.LEAVE})
# Include kicks
or (membership == Membership.LEAVE and sender != user_id)
)