diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-04-06 16:26:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 16:26:28 -0400 |
commit | d07d2558305057cba6a7e2cb7644c24cf2dcf9be (patch) | |
tree | 7d12d884981d2ffc275c5d10cf811606ce18ba97 /synapse/handlers/message.py | |
parent | Bump pyopenssl from 23.1.0 to 23.1.1 (#15373) (diff) | |
download | synapse-d07d2558305057cba6a7e2cb7644c24cf2dcf9be.tar.xz |
Implement MSC2175: remove the creator field from create events. (#15394)
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 4c75433a63..a17fe3bf53 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -1909,7 +1909,12 @@ class EventCreationHandler: room_version_obj = KNOWN_ROOM_VERSIONS[room_version] create_event = await self.store.get_create_event_for_room(event.room_id) - room_creator = create_event.content.get(EventContentFields.ROOM_CREATOR) + if not room_version_obj.msc2175_implicit_room_creator: + room_creator = create_event.content.get( + EventContentFields.ROOM_CREATOR + ) + else: + room_creator = create_event.sender # Only check an insertion event if the room version # supports it or the event is from the room creator. |