summary refs log tree commit diff
path: root/synapse/config/consent.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-04-11 12:07:23 -0400
committerGitHub <noreply@github.com>2022-04-11 12:07:23 -0400
commit4586119f0b0901be64f08655d3aaaef289a51bde (patch)
tree8150ea6084a6a7a034d272654720333d01b75b9f /synapse/config/consent.py
parentEnable certificate checking during complement tests (#12435) (diff)
downloadsynapse-4586119f0b0901be64f08655d3aaaef289a51bde.tar.xz
Add missing type hints to config classes. (#12402)
Diffstat (limited to 'synapse/config/consent.py')
-rw-r--r--synapse/config/consent.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/config/consent.py b/synapse/config/consent.py
index ecc43b08b9..8ee3d34521 100644
--- a/synapse/config/consent.py
+++ b/synapse/config/consent.py
@@ -13,9 +13,10 @@
 # limitations under the License.
 
 from os import path
-from typing import Optional
+from typing import Any, Optional
 
 from synapse.config import ConfigError
+from synapse.types import JsonDict
 
 from ._base import Config
 
@@ -76,18 +77,18 @@ class ConsentConfig(Config):
 
     section = "consent"
 
-    def __init__(self, *args):
+    def __init__(self, *args: Any):
         super().__init__(*args)
 
         self.user_consent_version: Optional[str] = None
         self.user_consent_template_dir: Optional[str] = None
-        self.user_consent_server_notice_content = None
+        self.user_consent_server_notice_content: Optional[JsonDict] = None
         self.user_consent_server_notice_to_guests = False
-        self.block_events_without_consent_error = None
+        self.block_events_without_consent_error: Optional[str] = None
         self.user_consent_at_registration = False
         self.user_consent_policy_name = "Privacy Policy"
 
-    def read_config(self, config, **kwargs):
+    def read_config(self, config: JsonDict, **kwargs: Any) -> None:
         consent_config = config.get("user_consent")
         self.terms_template = self.read_template("terms.html")
 
@@ -118,5 +119,5 @@ class ConsentConfig(Config):
             "policy_name", "Privacy Policy"
         )
 
-    def generate_config_section(self, **kwargs):
+    def generate_config_section(self, **kwargs: Any) -> str:
         return DEFAULT_CONFIG