diff options
author | Erik Johnston <erikj@jki.re> | 2019-01-25 10:20:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-25 10:20:22 +0000 |
commit | 03b7df1af231a4d60dbff7e38708a9aad7fa0aac (patch) | |
tree | 62626873812dfce5f24b556b406b47a47159b214 /synapse/storage | |
parent | Merge pull request #4448 from matrix-org/erikj/get_pdu_versions (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/require_fo... (diff) | |
download | synapse-03b7df1af231a4d60dbff7e38708a9aad7fa0aac.tar.xz |
Merge pull request #4451 from matrix-org/erikj/require_format_version
Require event format version to parse or create events
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/events_worker.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py index 599f892858..0a0ca58fc4 100644 --- a/synapse/storage/events_worker.py +++ b/synapse/storage/events_worker.py @@ -23,7 +23,7 @@ from twisted.internet import defer from synapse.api.constants import EventFormatVersions from synapse.api.errors import NotFoundError -from synapse.events import FrozenEvent +from synapse.events import FrozenEvent, event_type_from_format_version # noqa: F401 # these are only included to make the type annotations work from synapse.events.snapshot import EventContext # noqa: F401 from synapse.events.utils import prune_event @@ -412,11 +412,7 @@ class EventsWorkerStore(SQLBaseStore): # of a event format version, so it must be a V1 event. format_version = EventFormatVersions.V1 - # TODO: When we implement new event formats we'll need to use a - # different event python type - assert format_version == EventFormatVersions.V1 - - original_ev = FrozenEvent( + original_ev = event_type_from_format_version(format_version)( event_dict=d, internal_metadata_dict=internal_metadata, rejected_reason=rejected_reason, |