mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 04:56:01 -04:00
guard against accidental modification
This commit is contained in:
parent
617e8a4653
commit
898196f1cc
3 changed files with 30 additions and 3 deletions
|
@ -69,9 +69,10 @@ class ThirdPartyEventRules:
|
|||
events = await self.store.get_events(prev_state_ids.values())
|
||||
state_events = {(ev.type, ev.state_key): ev for ev in events.values()}
|
||||
|
||||
# The module can modify the event slightly if it wants, but caution should be
|
||||
# exercised, and it's likely to go very wrong if applied to events received over
|
||||
# federation.
|
||||
# Ensure that the event is frozen, to make sure that the module is not tempted
|
||||
# to try to modify it. Any attempt to modify it at this point will invalidate
|
||||
# the hashes and signatures.
|
||||
event.freeze()
|
||||
|
||||
return await self.third_party_rules.check_event_allowed(event, state_events)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue