summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-15 13:58:28 +0100
committerErik Johnston <erik@matrix.org>2014-08-15 13:58:28 +0100
commit114984a2361ee41005a769f6dc127c470ee08aee (patch)
treea295be465b71cbc048260b714e9fd042b4accb45 /synapse/storage/roommember.py
parentMerge branch 'master' of github.com:matrix-org/synapse into sql_refactor (diff)
downloadsynapse-114984a2361ee41005a769f6dc127c470ee08aee.tar.xz
Start chagning the events stream to work with the new DB schema
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r--synapse/storage/roommember.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 8c4b04f190..a0620677b9 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -63,6 +63,7 @@ class RoomMemberStore(SQLBaseStore):
             yield self._execute(None, sql, event.room_id, domain)
 
 
+    @defer.inlineCallbacks
     def get_room_member(self, user_id, room_id):
         """Retrieve the current state of a room member.
 
@@ -72,11 +73,13 @@ class RoomMemberStore(SQLBaseStore):
         Returns:
             Deferred: Results in a MembershipEvent or None.
         """
-        return self._get_members_by_dict({
+        rows = yield self._get_members_by_dict({
             "e.room_id": room_id,
             "m.user_id": user_id,
         })
 
+        defer.returnValue(rows[0] if rows else None)
+
     def get_room_members(self, room_id, membership=None):
         """Retrieve the current room member list for a room.
 
@@ -142,5 +145,8 @@ class RoomMemberStore(SQLBaseStore):
         ) % (where_clause,)
 
         rows = yield self._execute_and_decode(sql, *where_values)
+
+        logger.debug("_get_members_query Got rows %s", rows)
+
         results = [self._parse_event_from_row(r) for r in rows]
         defer.returnValue(results)