Compare commits

...

3 Commits

Author SHA1 Message Date
Mathieu Velten 9760d80a45
Update synapse/storage/databases/main/registration.py
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-09-22 22:26:10 +02:00
Mathieu Velten 1fcf73d8d1
Update synapse/storage/databases/main/registration.py
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-09-22 22:24:56 +02:00
Mathieu Velten ec723a46a2
Update changelog.d/8353.bugfix
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-09-22 22:24:36 +02:00
2 changed files with 3 additions and 5 deletions

View File

@ -1 +1 @@
Don't push if an user account has expired.
Don't send push notifications to expired user accounts.

View File

@ -125,12 +125,10 @@ class RegistrationWorkerStore(SQLBaseStore):
current_ts: The current timestamp
Returns:
Deferred[bool]: whether the user account has expired
Whether the user account has expired
"""
expiration_ts = await self.get_expiration_ts_for_user(user_id)
if expiration_ts is not None and current_ts >= expiration_ts:
return True
return False
return expiration_ts is not None and current_ts >= expiration_ts
async def set_account_validity_for_user(
self,