mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:06:06 -04:00
Rename 'user_name' to 'user_id' in push to make it consistent with the rest of the code
This commit is contained in:
parent
37716d55ed
commit
9c1f853d58
9 changed files with 99 additions and 99 deletions
|
@ -73,7 +73,7 @@ class PushRuleRestServlet(ClientV1RestServlet):
|
|||
|
||||
try:
|
||||
yield self.hs.get_datastore().add_push_rule(
|
||||
user_name=requester.user.to_string(),
|
||||
user_id=requester.user.to_string(),
|
||||
rule_id=_namespaced_rule_id_from_spec(spec),
|
||||
priority_class=priority_class,
|
||||
conditions=conditions,
|
||||
|
@ -206,7 +206,7 @@ class PushRuleRestServlet(ClientV1RestServlet):
|
|||
def on_OPTIONS(self, _):
|
||||
return 200, {}
|
||||
|
||||
def set_rule_attr(self, user_name, spec, val):
|
||||
def set_rule_attr(self, user_id, spec, val):
|
||||
if spec['attr'] == 'enabled':
|
||||
if isinstance(val, dict) and "enabled" in val:
|
||||
val = val["enabled"]
|
||||
|
@ -217,15 +217,15 @@ class PushRuleRestServlet(ClientV1RestServlet):
|
|||
raise SynapseError(400, "Value for 'enabled' must be boolean")
|
||||
namespaced_rule_id = _namespaced_rule_id_from_spec(spec)
|
||||
self.hs.get_datastore().set_push_rule_enabled(
|
||||
user_name, namespaced_rule_id, val
|
||||
user_id, namespaced_rule_id, val
|
||||
)
|
||||
else:
|
||||
raise UnrecognizedRequestError()
|
||||
|
||||
def get_rule_attr(self, user_name, namespaced_rule_id, attr):
|
||||
def get_rule_attr(self, user_id, namespaced_rule_id, attr):
|
||||
if attr == 'enabled':
|
||||
return self.hs.get_datastore().get_push_rule_enabled_by_user_rule_id(
|
||||
user_name, namespaced_rule_id
|
||||
user_id, namespaced_rule_id
|
||||
)
|
||||
else:
|
||||
raise UnrecognizedRequestError()
|
||||
|
|
|
@ -41,7 +41,7 @@ class PusherRestServlet(ClientV1RestServlet):
|
|||
and 'kind' in content and
|
||||
content['kind'] is None):
|
||||
yield pusher_pool.remove_pusher(
|
||||
content['app_id'], content['pushkey'], user_name=user.to_string()
|
||||
content['app_id'], content['pushkey'], user_id=user.to_string()
|
||||
)
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
|
@ -71,7 +71,7 @@ class PusherRestServlet(ClientV1RestServlet):
|
|||
|
||||
try:
|
||||
yield pusher_pool.add_pusher(
|
||||
user_name=user.to_string(),
|
||||
user_id=user.to_string(),
|
||||
access_token=requester.access_token_id,
|
||||
profile_tag=content['profile_tag'],
|
||||
kind=content['kind'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue