mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-21 12:04:36 -04:00
Use direct references for some configuration variables (part 3) (#10885)
This avoids the overhead of searching through the various configuration classes by directly referencing the class that the attributes are in. It also improves type hints since mypy can now resolve the types of the configuration variables.
This commit is contained in:
parent
aa2c027792
commit
e584534403
32 changed files with 137 additions and 119 deletions
|
@ -36,9 +36,11 @@ class ConsentServerNotices:
|
|||
|
||||
self._users_in_progress: Set[str] = set()
|
||||
|
||||
self._current_consent_version = hs.config.user_consent_version
|
||||
self._server_notice_content = hs.config.user_consent_server_notice_content
|
||||
self._send_to_guests = hs.config.user_consent_server_notice_to_guests
|
||||
self._current_consent_version = hs.config.consent.user_consent_version
|
||||
self._server_notice_content = (
|
||||
hs.config.consent.user_consent_server_notice_content
|
||||
)
|
||||
self._send_to_guests = hs.config.consent.user_consent_server_notice_to_guests
|
||||
|
||||
if self._server_notice_content is not None:
|
||||
if not self._server_notices_manager.is_enabled():
|
||||
|
@ -63,6 +65,9 @@ class ConsentServerNotices:
|
|||
# not enabled
|
||||
return
|
||||
|
||||
# A consent version must be given.
|
||||
assert self._current_consent_version is not None
|
||||
|
||||
# make sure we don't send two messages to the same user at once
|
||||
if user_id in self._users_in_progress:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue