mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -30,6 +30,7 @@ class AccountDataServlet(RestServlet):
|
|||
PUT /user/{user_id}/account_data/{account_dataType} HTTP/1.1
|
||||
GET /user/{user_id}/account_data/{account_dataType} HTTP/1.1
|
||||
"""
|
||||
|
||||
PATTERNS = client_patterns(
|
||||
"/user/(?P<user_id>[^/]*)/account_data/(?P<account_data_type>[^/]*)"
|
||||
)
|
||||
|
@ -52,9 +53,7 @@ class AccountDataServlet(RestServlet):
|
|||
user_id, account_data_type, body
|
||||
)
|
||||
|
||||
self.notifier.on_new_event(
|
||||
"account_data_key", max_id, users=[user_id]
|
||||
)
|
||||
self.notifier.on_new_event("account_data_key", max_id, users=[user_id])
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
|
@ -65,7 +64,7 @@ class AccountDataServlet(RestServlet):
|
|||
raise AuthError(403, "Cannot get account data for other users.")
|
||||
|
||||
event = yield self.store.get_global_account_data_by_type_for_user(
|
||||
account_data_type, user_id,
|
||||
account_data_type, user_id
|
||||
)
|
||||
|
||||
if event is None:
|
||||
|
@ -79,6 +78,7 @@ class RoomAccountDataServlet(RestServlet):
|
|||
PUT /user/{user_id}/rooms/{room_id}/account_data/{account_dataType} HTTP/1.1
|
||||
GET /user/{user_id}/rooms/{room_id}/account_data/{account_dataType} HTTP/1.1
|
||||
"""
|
||||
|
||||
PATTERNS = client_patterns(
|
||||
"/user/(?P<user_id>[^/]*)"
|
||||
"/rooms/(?P<room_id>[^/]*)"
|
||||
|
@ -103,16 +103,14 @@ class RoomAccountDataServlet(RestServlet):
|
|||
raise SynapseError(
|
||||
405,
|
||||
"Cannot set m.fully_read through this API."
|
||||
" Use /rooms/!roomId:server.name/read_markers"
|
||||
" Use /rooms/!roomId:server.name/read_markers",
|
||||
)
|
||||
|
||||
max_id = yield self.store.add_account_data_to_room(
|
||||
user_id, room_id, account_data_type, body
|
||||
)
|
||||
|
||||
self.notifier.on_new_event(
|
||||
"account_data_key", max_id, users=[user_id]
|
||||
)
|
||||
self.notifier.on_new_event("account_data_key", max_id, users=[user_id])
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
|
@ -123,7 +121,7 @@ class RoomAccountDataServlet(RestServlet):
|
|||
raise AuthError(403, "Cannot get account data for other users.")
|
||||
|
||||
event = yield self.store.get_account_data_for_room_and_type(
|
||||
user_id, room_id, account_data_type,
|
||||
user_id, room_id, account_data_type
|
||||
)
|
||||
|
||||
if event is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue