summary refs log tree commit diff
path: root/synapse/storage/room.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@fragile.org.uk>2018-04-09 17:21:34 +0100
committerNeil Johnson <neil@fragile.org.uk>2018-04-09 17:21:34 +0100
commit5e785d4d5b4137dfa596fde99c80ff94faff0a71 (patch)
treedaa6637c3c7db3b8f0fe1957f7719ffabb04e026 /synapse/storage/room.py
parentMerge branch 'release-v0.27.0' of https://github.com/matrix-org/synapse into ... (diff)
parentRevert "Merge pull request #3066 from matrix-org/rav/remove_redundant_metrics" (diff)
downloadsynapse-5e785d4d5b4137dfa596fde99c80ff94faff0a71.tar.xz
Merge branch 'develop' of https://github.com/matrix-org/synapse into release-v0.27.0
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r--synapse/storage/room.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 908551d6d9..740c036975 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -594,7 +594,8 @@ class RoomStore(RoomWorkerStore, SearchStore):
 
         while next_token:
             sql = """
-                SELECT stream_ordering, content FROM events
+                SELECT stream_ordering, json FROM events
+                JOIN event_json USING (event_id)
                 WHERE room_id = ?
                     AND stream_ordering < ?
                     AND contains_url = ? AND outlier = ?
@@ -606,8 +607,8 @@ class RoomStore(RoomWorkerStore, SearchStore):
             next_token = None
             for stream_ordering, content_json in txn:
                 next_token = stream_ordering
-                content = json.loads(content_json)
-
+                event_json = json.loads(content_json)
+                content = event_json["content"]
                 content_url = content.get("url")
                 thumbnail_url = content.get("info", {}).get("thumbnail_url")