summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-12-19 17:36:33 +0000
committerKegan Dougal <kegan@matrix.org>2014-12-19 17:36:33 +0000
commit67a406a7540f21aae2fde325c66422cffa27fbfa (patch)
tree5a2718aa89520bcb6bd863b0d690b83bc039040a
parentSet a state_key for the topic and room name, otherwise they won't be treated ... (diff)
downloadsynapse-67a406a7540f21aae2fde325c66422cffa27fbfa.tar.xz
Rate limit display names and avatar urls per request rather than per event.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/profile.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index 33a2c167ec..3f11e2dcf4 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -194,6 +194,8 @@ class ProfileHandler(BaseHandler):
         if not self.hs.is_mine(user):
             return
 
+        self.ratelimit(user.to_string())
+
         joins = yield self.store.get_rooms_for_user_where_membership_is(
             user.to_string(),
             [Membership.JOIN],
@@ -214,5 +216,5 @@ class ProfileHandler(BaseHandler):
                 "room_id": j.room_id,
                 "state_key": j.state_key,
                 "content": content,
-                "sender": j.state_key,
-            })
+                "sender": j.state_key
+            }, ratelimit=False)