summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-19 15:16:48 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-19 15:16:48 +0000
commit9c71d945d6072323df6d1e183efc4b6f7ad35237 (patch)
tree3742b951efb62d46ea29d4f77e679cec853e89e2 /synapse
parentbump_presence_active_time when sending a message event (diff)
downloadsynapse-9c71d945d6072323df6d1e183efc4b6f7ad35237.tar.xz
Look for name, topic in the event content rather than the event itself when persisting room name and topic events
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/room.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 2378d65943..c20abbfe4d 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -135,26 +135,26 @@ class RoomStore(SQLBaseStore):
         defer.returnValue(ret)
 
     def _store_room_topic_txn(self, txn, event):
-        if hasattr(event, "topic"):
+        if hasattr(event, "content") and "topic" in event.content:
             self._simple_insert_txn(
                 txn,
                 "topics",
                 {
                     "event_id": event.event_id,
                     "room_id": event.room_id,
-                    "topic": event.topic,
+                    "topic": event.content["topic"],
                 }
             )
 
     def _store_room_name_txn(self, txn, event):
-        if hasattr(event, "name"):
+        if hasattr(event, "content") and "name" in event.content:
             self._simple_insert_txn(
                 txn,
                 "room_names",
                 {
                     "event_id": event.event_id,
                     "room_id": event.room_id,
-                    "name": event.name,
+                    "name": event.content["name"],
                 }
             )