Don't unfreeze when using FreezeEvent.get_dict, as we are using a JSONEncoder that understands FrozenDict

This commit is contained in:
Erik Johnston 2015-02-11 15:44:28 +00:00
parent 4ebbaf0d43
commit ddb816cf60
6 changed files with 36 additions and 13 deletions

View file

@ -298,12 +298,16 @@ class DataStore(RoomMemberStore, RoomStore,
or_replace=True,
)
content = encode_canonical_json(
event.content
).decode("UTF-8")
vals = {
"topological_ordering": event.depth,
"event_id": event.event_id,
"type": event.type,
"room_id": event.room_id,
"content": json.dumps(event.get_dict()["content"]),
"content": content,
"processed": True,
"outlier": outlier,
"depth": event.depth,
@ -323,7 +327,10 @@ class DataStore(RoomMemberStore, RoomStore,
"prev_events",
]
}
vals["unrecognized_keys"] = json.dumps(unrec)
vals["unrecognized_keys"] = encode_canonical_json(
unrec
).decode("UTF-8")
try:
self._simple_insert_txn(