summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-24 16:19:24 +0000
committerErik Johnston <erik@matrix.org>2015-03-24 16:19:24 +0000
commit5a447098dd8442c7c69b2db22d42e6ce40c2dc6e (patch)
treef0290f356f773b276876223559ab8500ecaa796c
parentDon't order by rowid (diff)
downloadsynapse-5a447098dd8442c7c69b2db22d42e6ce40c2dc6e.tar.xz
Don't use room hosts table
Diffstat (limited to '')
-rw-r--r--synapse/storage/roommember.py29
1 files changed, 4 insertions, 25 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index a229505208..df707f8124 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -65,26 +65,6 @@ class RoomMemberStore(SQLBaseStore):
             }
         )
 
-        # Update room hosts table
-        if event.membership == Membership.JOIN:
-            sql = (
-                "REPLACE INTO room_hosts (room_id, host) "
-                "VALUES (?, ?)"
-            )
-            txn.execute(sql, (event.room_id, domain))
-        elif event.membership != Membership.INVITE:
-            # Check if this was the last person to have left.
-            joined_domains = self._get_joined_hosts_for_room_txn(
-                txn, event.room_id
-            )
-
-            if domain not in joined_domains:
-                sql = (
-                    "DELETE FROM room_hosts WHERE room_id = ? AND host = ?"
-                )
-
-                txn.execute(sql, (event.room_id, domain))
-
         self.get_rooms_for_user.invalidate(target_user_id)
 
     def get_room_member(self, user_id, room_id):
@@ -229,11 +209,10 @@ class RoomMemberStore(SQLBaseStore):
             where_values.append(user_id)
 
         sql = (
-            "SELECT m.* FROM room_memberships as m "
-            "ON e.event_id = m.event_id "
-            "INNER JOIN current_state_events as c "
-            "ON m.event_id = c.event_id "
-            "WHERE %(where)s "
+            "SELECT m.* FROM room_memberships as m"
+            " INNER JOIN current_state_events as c"
+            " ON m.event_id = c.event_id"
+            " WHERE %(where)s"
         ) % {
             "where": where_clause,
         }