mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 23:43:55 +01:00
Copy over non-federatable trait on room upgrade
This commit is contained in:
parent
6587b0b89b
commit
d621c5562e
1 changed files with 14 additions and 0 deletions
|
@ -263,6 +263,20 @@ class RoomCreationHandler(BaseHandler):
|
|||
}
|
||||
}
|
||||
|
||||
# Check if old room was non-federatable
|
||||
|
||||
# Get old room's create event
|
||||
old_room_create_event_ids = yield self.store.get_filtered_current_state_ids(
|
||||
old_room_id, StateFilter.from_types(((EventTypes.Create, ""),)),
|
||||
)
|
||||
old_room_create_event_dict = yield self.store.get_events(old_room_create_event_ids.values())
|
||||
old_room_create_event = list(old_room_create_event_dict.values())[0]
|
||||
|
||||
# Check if the create event specified a non-federatable room
|
||||
if old_room_create_event.content.get("m.federate", True) == False:
|
||||
# If so, mark the new room as non-federatable as well
|
||||
creation_content["m.federate"] = False
|
||||
|
||||
initial_state = dict()
|
||||
|
||||
# Replicate relevant room events
|
||||
|
|
Loading…
Reference in a new issue