mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-13 22:13:29 +01:00
Enable rate limiting for all events
This commit is contained in:
parent
23da4a4051
commit
f06161a307
1 changed files with 5 additions and 0 deletions
|
@ -154,6 +154,11 @@ class MessageHandler(BaseHandler):
|
||||||
|
|
||||||
self.validator.validate_new(builder)
|
self.validator.validate_new(builder)
|
||||||
|
|
||||||
|
self.ratelimit(builder.user_id)
|
||||||
|
# TODO(paul): Why does 'event' not have a 'user' object?
|
||||||
|
user = self.hs.parse_userid(builder.user_id)
|
||||||
|
assert self.hs.is_mine(user), "User must be our own: %s" % (user,)
|
||||||
|
|
||||||
if builder.type == EventTypes.Member:
|
if builder.type == EventTypes.Member:
|
||||||
membership = builder.content.get("membership", None)
|
membership = builder.content.get("membership", None)
|
||||||
if membership == Membership.JOIN:
|
if membership == Membership.JOIN:
|
||||||
|
|
Loading…
Reference in a new issue