summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-07-18 10:05:30 +0100
committerGitHub <noreply@github.com>2022-07-18 10:05:30 +0100
commitc6a05063ff26502d126be33dd4ae2854ea88cbab (patch)
treea36f08cc6fd88f9d4813a23852049cf9061a05e9 /synapse/events
parentRemove unnecessary `json.dumps` from tests (#13303) (diff)
downloadsynapse-c6a05063ff26502d126be33dd4ae2854ea88cbab.tar.xz
Don't pull out the full state when creating an event (#13281)
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/builder.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/events/builder.py b/synapse/events/builder.py
index 4caf6cbdee..17f624b68f 100644
--- a/synapse/events/builder.py
+++ b/synapse/events/builder.py
@@ -24,9 +24,11 @@ from synapse.api.room_versions import (
     RoomVersion,
 )
 from synapse.crypto.event_signing import add_hashes_and_signatures
+from synapse.event_auth import auth_types_for_event
 from synapse.events import EventBase, _EventInternalMetadata, make_event_from_dict
 from synapse.state import StateHandler
 from synapse.storage.databases.main import DataStore
+from synapse.storage.state import StateFilter
 from synapse.types import EventID, JsonDict
 from synapse.util import Clock
 from synapse.util.stringutils import random_string
@@ -121,7 +123,11 @@ class EventBuilder:
         """
         if auth_event_ids is None:
             state_ids = await self._state.compute_state_after_events(
-                self.room_id, prev_event_ids
+                self.room_id,
+                prev_event_ids,
+                state_filter=StateFilter.from_types(
+                    auth_types_for_event(self.room_version, self)
+                ),
             )
             auth_event_ids = self._event_auth_handler.compute_auth_events(
                 self, state_ids