summary refs log tree commit diff
path: root/synapse/storage/relations.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-17 18:01:39 +0100
committerErik Johnston <erik@matrix.org>2019-05-17 18:03:10 +0100
commitb63cc325a9362874a13f0079589afccd7d108f1f (patch)
treefb732ab51ca00292646bc27b71934893b82965ef /synapse/storage/relations.py
parentMake tests use different user for each reaction it sends (diff)
downloadsynapse-b63cc325a9362874a13f0079589afccd7d108f1f.tar.xz
Only count aggregations from distinct senders
As a user isn't allowed to send a single emoji more than once.
Diffstat (limited to 'synapse/storage/relations.py')
-rw-r--r--synapse/storage/relations.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/relations.py b/synapse/storage/relations.py
index 6e216066ab..42f587a7d8 100644
--- a/synapse/storage/relations.py
+++ b/synapse/storage/relations.py
@@ -280,7 +280,7 @@ class RelationsWorkerStore(SQLBaseStore):
             having_clause = ""
 
         sql = """
-            SELECT type, aggregation_key, COUNT(*), MAX(stream_ordering)
+            SELECT type, aggregation_key, COUNT(DISTINCT sender), MAX(stream_ordering)
             FROM event_relations
             INNER JOIN events USING (event_id)
             WHERE {where_clause}