summary refs log tree commit diff
path: root/synapse/module_api
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-08-17 14:45:24 +0200
committerGitHub <noreply@github.com>2021-08-17 14:45:24 +0200
commit56397599809e131174daaeb4c6dc18fde9db6c3f (patch)
tree89143336c80709dcab3834eeae1af9d6de069254 /synapse/module_api
parentAttempt to pull from the legacy spaces summary API over federation. (#10583) (diff)
downloadsynapse-56397599809e131174daaeb4c6dc18fde9db6c3f.tar.xz
Centralise the custom template directory (#10596)
Several configuration sections are using separate settings for custom template directories, which can be confusing. This PR adds a new top-level configuration for a custom template directory which is then used for every module. The only exception is the consent templates, since the consent template directory require a specific hierarchy, so it's probably better that it stays separate from everything else.
Diffstat (limited to 'synapse/module_api')
-rw-r--r--synapse/module_api/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py
index 82725853bc..2f99d31c42 100644
--- a/synapse/module_api/__init__.py
+++ b/synapse/module_api/__init__.py
@@ -91,6 +91,7 @@ class ModuleApi:
         self._state = hs.get_state_handler()
         self._clock: Clock = hs.get_clock()
         self._send_email_handler = hs.get_send_email_handler()
+        self.custom_template_dir = hs.config.server.custom_template_directory
 
         try:
             app_name = self._hs.config.email_app_name
@@ -679,7 +680,7 @@ class ModuleApi:
         """
         return self._hs.config.read_templates(
             filenames,
-            (td for td in (custom_template_directory,) if td),
+            (td for td in (self.custom_template_dir, custom_template_directory) if td),
         )