summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-21 17:10:48 +0100
committerGitHub <noreply@github.com>2019-05-21 17:10:48 +0100
commitf4c80d70f86d7573ff5e3c57a82126cc765fcafb (patch)
tree91db97c52ae7154e67233f9161406c8f50b45281
parentMerge pull request #5212 from matrix-org/erikj/deny_multiple_reactions (diff)
parentNewsfile (diff)
downloadsynapse-f4c80d70f86d7573ff5e3c57a82126cc765fcafb.tar.xz
Merge pull request #5203 from matrix-org/erikj/aggregate_by_sender
Only count aggregations from distinct senders
-rw-r--r--changelog.d/5203.feature1
-rw-r--r--synapse/storage/relations.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/5203.feature b/changelog.d/5203.feature
new file mode 100644
index 0000000000..747098c166
--- /dev/null
+++ b/changelog.d/5203.feature
@@ -0,0 +1 @@
+Add experimental support for relations (aka reactions and edits).
diff --git a/synapse/storage/relations.py b/synapse/storage/relations.py
index 7d51b38d77..4c83800cca 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}