Skip to content
Snippets Groups Projects
Unverified Commit da0090fd authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Fix modifying events in `ThirdPartyRules` modules (#8564)

EventBuilder.build wants auth events these days
parent 5649669c
No related branches found
No related tags found
No related merge requests found
Support modifying event content in `ThirdPartyRules` modules.
...@@ -98,7 +98,7 @@ class EventBuilder: ...@@ -98,7 +98,7 @@ class EventBuilder:
return self._state_key is not None return self._state_key is not None
async def build( async def build(
self, prev_event_ids: List[str], auth_event_ids: Optional[List[str]] self, prev_event_ids: List[str], auth_event_ids: Optional[List[str]],
) -> EventBase: ) -> EventBase:
"""Transform into a fully signed and hashed event """Transform into a fully signed and hashed event
......
...@@ -1364,7 +1364,12 @@ class EventCreationHandler: ...@@ -1364,7 +1364,12 @@ class EventCreationHandler:
for k, v in original_event.internal_metadata.get_dict().items(): for k, v in original_event.internal_metadata.get_dict().items():
setattr(builder.internal_metadata, k, v) setattr(builder.internal_metadata, k, v)
event = await builder.build(prev_event_ids=original_event.prev_event_ids()) # the event type hasn't changed, so there's no point in re-calculating the
# auth events.
event = await builder.build(
prev_event_ids=original_event.prev_event_ids(),
auth_event_ids=original_event.auth_event_ids(),
)
# we rebuild the event context, to be on the safe side. If nothing else, # we rebuild the event context, to be on the safe side. If nothing else,
# delta_ids might need an update. # delta_ids might need an update.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment