0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 23:13:52 +01:00

Stop internal keys from getting into SynapseEvents

This commit is contained in:
Erik Johnston 2014-08-21 15:06:00 +01:00
parent 1587ea26fe
commit 063e1b22e6
2 changed files with 6 additions and 0 deletions

View file

@ -51,6 +51,7 @@ class SynapseEvent(JsonEncodedObject):
"depth",
"destinations",
"origin",
"outlier",
]
required_keys = [

View file

@ -294,6 +294,11 @@ class SQLBaseStore(object):
def _parse_event_from_row(self, row_dict):
d = copy.deepcopy({k: v for k, v in row_dict.items() if v})
d.pop("stream_ordering", None)
d.pop("topological_ordering", None)
d.pop("processed", None)
d.update(json.loads(row_dict["unrecognized_keys"]))
d["content"] = json.loads(d["content"])
del d["unrecognized_keys"]