diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-18 15:41:40 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-22 11:54:51 +0100 |
commit | d5dca9a04fbac7fea0822eaf2fd513b13449184c (patch) | |
tree | 8d2f5e5a6f21f6461b64878f3fef6f2e5500e3ce /synapse/config/consent_config.py | |
parent | Send users a server notice about consent (diff) | |
download | synapse-d5dca9a04fbac7fea0822eaf2fd513b13449184c.tar.xz |
Move consent config parsing into ConsentConfig
turns out we need to reuse this, so it's better in the config class.
Diffstat (limited to 'synapse/config/consent_config.py')
-rw-r--r-- | synapse/config/consent_config.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/synapse/config/consent_config.py b/synapse/config/consent_config.py index a6fbc5a058..8698b2993f 100644 --- a/synapse/config/consent_config.py +++ b/synapse/config/consent_config.py @@ -45,8 +45,22 @@ DEFAULT_CONFIG = """\ class ConsentConfig(Config): + def __init__(self): + super(ConsentConfig, self).__init__() + + self.user_consent_version = None + self.user_consent_template_dir = None + self.user_consent_server_notice_content = None + def read_config(self, config): - self.consent_config = config.get("user_consent") + consent_config = config.get("user_consent") + if consent_config is None: + return + self.user_consent_version = str(consent_config["version"]) + self.user_consent_template_dir = consent_config["template_dir"] + self.user_consent_server_notice_content = consent_config.get( + "server_notice_content", + ) def default_config(self, **kwargs): return DEFAULT_CONFIG |