1 files changed, 18 insertions, 10 deletions
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py
index 125902ac17..022789ea5f 100644
--- a/synapse/handlers/account_validity.py
+++ b/synapse/handlers/account_validity.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright 2019 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,38 +42,47 @@ class AccountValidityHandler:
self.sendmail = self.hs.get_sendmail()
self.clock = self.hs.get_clock()
- self._account_validity_enabled = self.hs.config.account_validity_enabled
+ self._account_validity_enabled = (
+ hs.config.account_validity.account_validity_enabled
+ )
self._account_validity_renew_by_email_enabled = (
- self.hs.config.account_validity_renew_by_email_enabled
+ hs.config.account_validity.account_validity_renew_by_email_enabled
)
+
self._show_users_in_user_directory = self.hs.config.show_users_in_user_directory
self.profile_handler = self.hs.get_profile_handler()
self._account_validity_period = None
if self._account_validity_enabled:
- self._account_validity_period = self.hs.config.account_validity_period
+ self._account_validity_period = (
+ hs.config.account_validity.account_validity_period
+ )
if (
self._account_validity_enabled
and self._account_validity_renew_by_email_enabled
):
# Don't do email-specific configuration if renewal by email is disabled.
- self._template_html = self.config.account_validity_template_html
- self._template_text = self.config.account_validity_template_text
+ self._template_html = (
+ hs.config.account_validity.account_validity_template_html
+ )
+ self._template_text = (
+ hs.config.account_validity.account_validity_template_text
+ )
account_validity_renew_email_subject = (
- self.hs.config.account_validity_renew_email_subject
+ hs.config.account_validity.account_validity_renew_email_subject
)
try:
- app_name = self.hs.config.email_app_name
+ app_name = hs.config.email_app_name
self._subject = account_validity_renew_email_subject % {"app": app_name}
- self._from_string = self.hs.config.email_notif_from % {"app": app_name}
+ self._from_string = hs.config.email_notif_from % {"app": app_name}
except Exception:
# If substitution failed, fall back to the bare strings.
self._subject = account_validity_renew_email_subject
- self._from_string = self.hs.config.email_notif_from
+ self._from_string = hs.config.email_notif_from
self._raw_from = email.utils.parseaddr(self._from_string)[1]
|