summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-03-16 10:09:15 +0000
committerKegan Dougal <kegan@matrix.org>2015-03-16 10:09:15 +0000
commitf9232c7917322de392921336b4bab5d85c213c4e (patch)
treeab55547f1c895da508e6ac37c8056fef5b3b754e /synapse/storage/__init__.py
parentFix remaining scheduler bugs. Add more informative logging. (diff)
parentadd ToC and fix typoe (diff)
downloadsynapse-f9232c7917322de392921336b4bab5d85c213c4e.tar.xz
Merge branch 'develop' into application-services-txn-reliability
Conflicts:
	synapse/storage/appservice.py
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 6c159b52a0..efef859214 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -453,7 +453,7 @@ class DataStore(RoomMemberStore, RoomStore,
         else:
             args = (room_id, )
 
-        results = yield self._execute_and_decode(sql, *args)
+        results = yield self._execute_and_decode("get_current_state", sql, *args)
 
         events = yield self._parse_events(results)
         defer.returnValue(events)
@@ -478,7 +478,7 @@ class DataStore(RoomMemberStore, RoomStore,
         sql += " OR s.type = 'm.room.aliases')"
         args = (room_id,)
 
-        results = yield self._execute_and_decode(sql, *args)
+        results = yield self._execute_and_decode("get_current_state", sql, *args)
 
         events = yield self._parse_events(results)
 
@@ -487,17 +487,18 @@ class DataStore(RoomMemberStore, RoomStore,
 
         for e in events:
             if e.type == 'm.room.name':
-                name = e.content['name']
+                if 'name' in e.content:
+                    name = e.content['name']
             elif e.type == 'm.room.aliases':
-                aliases.extend(e.content['aliases'])
+                if 'aliases' in e.content:
+                    aliases.extend(e.content['aliases'])
 
         defer.returnValue((name, aliases))
 
     @defer.inlineCallbacks
     def _get_min_token(self):
         row = yield self._execute(
-            None,
-            "SELECT MIN(stream_ordering) FROM events"
+            "_get_min_token", None, "SELECT MIN(stream_ordering) FROM events"
         )
 
         self.min_token = row[0][0] if row and row[0] and row[0][0] else -1