summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-03 18:02:33 +0000
committerErik Johnston <erik@matrix.org>2014-12-03 18:02:33 +0000
commit036516d647c6fbd8ec4642a3308e73f71868b1b3 (patch)
tree6cfacc683f68a9e9748058335c36e8ee2fa7f83d /synapse/storage/roommember.py
parentBump version (diff)
parentBump changes and version (diff)
downloadsynapse-036516d647c6fbd8ec4642a3308e73f71868b1b3.tar.xz
Merge branch 'release-v0.5.4' of github.com:matrix-org/synapse v0.5.4
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r--synapse/storage/roommember.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index c37df59d45..05b275663e 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -218,7 +218,9 @@ class RoomMemberStore(SQLBaseStore):
             "ON m.event_id = c.event_id "
             "WHERE m.membership = 'join' "
             "AND (%(clause)s) "
-            "GROUP BY m.room_id HAVING COUNT(m.room_id) = ?"
+            # TODO(paul): We've got duplicate rows in the database somewhere
+            #   so we have to DISTINCT m.user_id here
+            "GROUP BY m.room_id HAVING COUNT(DISTINCT m.user_id) = ?"
         ) % {"clause": user_list_clause}
 
         args = list(user_id_list)