diff options
author | David Baker <dave@matrix.org> | 2017-11-08 11:46:24 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-11-08 11:46:24 +0000 |
commit | 1b870937ae2de0ba510f0e1db40ae0e9a316d83f (patch) | |
tree | 5618bac3a11b48c70e77bdf194784bad07786a0e /synapse/config | |
parent | Rename redact_content option to include_content (diff) | |
download | synapse-1b870937ae2de0ba510f0e1db40ae0e9a316d83f.tar.xz |
Log if any of the old config flags are set
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/push.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/synapse/config/push.py b/synapse/config/push.py index 01d4a49784..861f5f31a7 100644 --- a/synapse/config/push.py +++ b/synapse/config/push.py @@ -16,14 +16,36 @@ from ._base import Config +import logging + +from twisted.internet import reactor + + +logger = logging.getLogger(__name__) + class PushConfig(Config): def read_config(self, config): - self.push_include_content = True - push_config = config.get("push", {}) self.push_include_content = push_config.get("include_content", True) + if push_config.get("redact_content") is not None: + reactor.callWhenRunning(lambda: logger.warn( + "The push.redact_content content option has never worked. " + "Please set push.include_content if you want this behaviour" + )) + + # There was a a 'redact_content' setting but mistakenly read from the + # 'email' section: check for it and honour it, with a warning. + push_config = config.get("email", {}) + redact_content = push_config.get("redact_content") + if redact_content is not None: + reactor.callWhenRunning(lambda: logger.warn( + "The 'email.redact_content' option is deprecated: " + "please set push.include_content instead" + )) + self.push_include_content = not redact_content + def default_config(self, config_dir_path, server_name, **kwargs): return """ # Clients requesting push notifications can either have the body of |