mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-16 00:23:50 -05:00
Fix that user cannot /forget rooms after the last member has left (#13546)
This commit is contained in:
parent
51d732db3b
commit
682dfcfc0d
4 changed files with 99 additions and 6 deletions
|
|
@ -1925,8 +1925,11 @@ class RoomMemberMasterHandler(RoomMemberHandler):
|
|||
]:
|
||||
raise SynapseError(400, "User %s in room %s" % (user_id, room_id))
|
||||
|
||||
if membership:
|
||||
await self.store.forget(user_id, room_id)
|
||||
# In normal case this call is only required if `membership` is not `None`.
|
||||
# But: After the last member had left the room, the background update
|
||||
# `_background_remove_left_rooms` is deleting rows related to this room from
|
||||
# the table `current_state_events` and `get_current_state_events` is `None`.
|
||||
await self.store.forget(user_id, room_id)
|
||||
|
||||
|
||||
def get_users_which_can_issue_invite(auth_events: StateMap[EventBase]) -> List[str]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue