diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2020-08-06 10:52:50 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2020-08-06 10:52:50 +0100 |
commit | 118a9eafb31fbd51d23ef8abbaac481579b7f9e5 (patch) | |
tree | ba84cd874fbe43c4981abaa3d8aa2c9913d5097b /synapse/server_notices/consent_server_notices.py | |
parent | Incorporate review (diff) | |
parent | Fixup worker doc (again) (#8000) (diff) | |
download | synapse-118a9eafb31fbd51d23ef8abbaac481579b7f9e5.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into babolivier/new_push_rules
Diffstat (limited to 'synapse/server_notices/consent_server_notices.py')
-rw-r--r-- | synapse/server_notices/consent_server_notices.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/synapse/server_notices/consent_server_notices.py b/synapse/server_notices/consent_server_notices.py index 3bfc8d7278..089cfef0b3 100644 --- a/synapse/server_notices/consent_server_notices.py +++ b/synapse/server_notices/consent_server_notices.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +from typing import Any from synapse.api.errors import SynapseError from synapse.api.urls import ConsentURIBuilder @@ -55,14 +56,11 @@ class ConsentServerNotices(object): self._consent_uri_builder = ConsentURIBuilder(hs.config) - async def maybe_send_server_notice_to_user(self, user_id): + async def maybe_send_server_notice_to_user(self, user_id: str) -> None: """Check if we need to send a notice to this user, and does so if so Args: - user_id (str): user to check - - Returns: - Deferred + user_id: user to check """ if self._server_notice_content is None: # not enabled @@ -105,7 +103,7 @@ class ConsentServerNotices(object): self._users_in_progress.remove(user_id) -def copy_with_str_subst(x, substitutions): +def copy_with_str_subst(x: Any, substitutions: Any) -> Any: """Deep-copy a structure, carrying out string substitions on any strings Args: @@ -121,7 +119,7 @@ def copy_with_str_subst(x, substitutions): if isinstance(x, dict): return {k: copy_with_str_subst(v, substitutions) for (k, v) in x.items()} if isinstance(x, (list, tuple)): - return [copy_with_str_subst(y) for y in x] + return [copy_with_str_subst(y, substitutions) for y in x] # assume it's uninterested and can be shallow-copied. return x |