Port "Allow users to click account renewal links multiple times without hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832)

This attempts to be a direct port of https://github.com/matrix-org/synapse-dinsic/pull/74 to mainline. There was some fiddling required to deal with the changes that have been made to mainline since (mainly dealing with the split of `RegistrationWorkerStore` from `RegistrationStore`, and the changes made to `self.make_request` in test code).
This commit is contained in:
Andrew Morgan 2021-04-19 19:16:34 +01:00 committed by GitHub
parent e694a598f8
commit 71f0623de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 496 additions and 263 deletions

View file

@ -62,7 +62,9 @@ class PusherPool:
self.store = self.hs.get_datastore()
self.clock = self.hs.get_clock()
self._account_validity = hs.config.account_validity
self._account_validity_enabled = (
hs.config.account_validity.account_validity_enabled
)
# We shard the handling of push notifications by user ID.
self._pusher_shard_config = hs.config.push.pusher_shard_config
@ -236,7 +238,7 @@ class PusherPool:
for u in users_affected:
# Don't push if the user account has expired
if self._account_validity.enabled:
if self._account_validity_enabled:
expired = await self.store.is_account_expired(
u, self.clock.time_msec()
)
@ -266,7 +268,7 @@ class PusherPool:
for u in users_affected:
# Don't push if the user account has expired
if self._account_validity.enabled:
if self._account_validity_enabled:
expired = await self.store.is_account_expired(
u, self.clock.time_msec()
)