mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fixed syntax nits
This commit is contained in:
parent
627e6ea2b0
commit
224137fcf9
@ -52,9 +52,8 @@ def client_v2_patterns(path_regex, releases=(0,),
|
||||
def set_timeline_upper_limit(filter_json, filter_timeline_limit):
|
||||
if filter_timeline_limit < 0:
|
||||
return # no upper limits
|
||||
if 'room' in filter_json \
|
||||
and 'timeline' in filter_json['room'] \
|
||||
and 'limit' in filter_json['room']['timeline']:
|
||||
timeline = filter_json.get('room', {}).get('timeline', {})
|
||||
if 'limit' in timeline:
|
||||
filter_json['room']['timeline']["limit"] = min(
|
||||
filter_json['room']['timeline']['limit'],
|
||||
filter_timeline_limit)
|
||||
|
@ -86,8 +86,10 @@ class CreateFilterRestServlet(RestServlet):
|
||||
raise AuthError(403, "Can only create filters for local users")
|
||||
|
||||
content = parse_json_object_from_request(request)
|
||||
set_timeline_upper_limit(content,
|
||||
self.hs.config.filter_timeline_limit)
|
||||
set_timeline_upper_limit(
|
||||
content,
|
||||
self.hs.config.filter_timeline_limit
|
||||
)
|
||||
|
||||
filter_id = yield self.filtering.add_user_filter(
|
||||
user_localpart=target_user.localpart,
|
||||
|
Loading…
Reference in New Issue
Block a user