Fix comments
Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>pull/6015/head
parent
caa9d6fed7
commit
57dd41a45b
|
@ -110,7 +110,7 @@ class RatelimitConfig(Config):
|
||||||
# attempts for this account.
|
# attempts for this account.
|
||||||
# - one for ratelimiting redactions by room admins. If this is not explicitly
|
# - one for ratelimiting redactions by room admins. If this is not explicitly
|
||||||
# set then it uses the same ratelimiting as per rc_message. This is useful
|
# set then it uses the same ratelimiting as per rc_message. This is useful
|
||||||
# to allow room admins to quickly deal with abuse quickly.
|
# to allow room admins to deal with abuse quickly.
|
||||||
#
|
#
|
||||||
# The defaults are as shown below.
|
# The defaults are as shown below.
|
||||||
#
|
#
|
||||||
|
|
|
@ -105,7 +105,7 @@ class BaseHandler(object):
|
||||||
|
|
||||||
if is_admin_redaction and self.hs.config.rc_admin_redaction:
|
if is_admin_redaction and self.hs.config.rc_admin_redaction:
|
||||||
# If we have separate config for admin redactions we use a separate
|
# If we have separate config for admin redactions we use a separate
|
||||||
# ratelimiter.
|
# ratelimiter
|
||||||
allowed, time_allowed = self.admin_redaction_ratelimiter.can_do_action(
|
allowed, time_allowed = self.admin_redaction_ratelimiter.can_do_action(
|
||||||
user_id,
|
user_id,
|
||||||
time_now,
|
time_now,
|
||||||
|
|
|
@ -731,7 +731,7 @@ class EventCreationHandler(object):
|
||||||
if ratelimit:
|
if ratelimit:
|
||||||
# We check if this is a room admin redacting an event so that we
|
# We check if this is a room admin redacting an event so that we
|
||||||
# can apply different ratelimiting. We do this by simply checking
|
# can apply different ratelimiting. We do this by simply checking
|
||||||
# its not a self-redaction (to avoid having to look up whether the
|
# it's not a self-redaction (to avoid having to look up whether the
|
||||||
# user is actually admin or not).
|
# user is actually admin or not).
|
||||||
is_admin_redaction = False
|
is_admin_redaction = False
|
||||||
if event.type == EventTypes.Redaction:
|
if event.type == EventTypes.Redaction:
|
||||||
|
|
|
@ -197,8 +197,8 @@ class RedactionsTestCase(HomeserverTestCase):
|
||||||
message_ids.append(b["event_id"])
|
message_ids.append(b["event_id"])
|
||||||
self.reactor.advance(10) # To get around ratelimits
|
self.reactor.advance(10) # To get around ratelimits
|
||||||
|
|
||||||
# as the moderator, send a bunch of redactions redaction
|
# as the moderator, send a bunch of redactions
|
||||||
for msg_id in message_ids:
|
for msg_id in message_ids:
|
||||||
# These should all succeed, even though this would be denied by
|
# These should all succeed, even though this would be denied by
|
||||||
# standard message ratelimiter
|
# the standard message ratelimiter
|
||||||
self._redact_event(self.mod_access_token, self.room_id, msg_id)
|
self._redact_event(self.mod_access_token, self.room_id, msg_id)
|
||||||
|
|
Loading…
Reference in New Issue