mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 19:23:53 +01:00
Fix modifying events in ThirdPartyRules
modules (#8564)
EventBuilder.build wants auth events these days
This commit is contained in:
parent
5649669c3c
commit
da0090fdff
3 changed files with 8 additions and 2 deletions
1
changelog.d/8564.feature
Normal file
1
changelog.d/8564.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Support modifying event content in `ThirdPartyRules` modules.
|
|
@ -98,7 +98,7 @@ class EventBuilder:
|
|||
return self._state_key is not None
|
||||
|
||||
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:
|
||||
"""Transform into a fully signed and hashed event
|
||||
|
||||
|
|
|
@ -1364,7 +1364,12 @@ class EventCreationHandler:
|
|||
for k, v in original_event.internal_metadata.get_dict().items():
|
||||
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,
|
||||
# delta_ids might need an update.
|
||||
|
|
Loading…
Reference in a new issue