mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-23 10:54:10 -04:00
Don't push if an user account has expired (#8353)
This commit is contained in:
parent
4bb203ea4f
commit
916bb9d0d1
4 changed files with 34 additions and 5 deletions
|
@ -116,6 +116,20 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||
desc="get_expiration_ts_for_user",
|
||||
)
|
||||
|
||||
async def is_account_expired(self, user_id: str, current_ts: int) -> bool:
|
||||
"""
|
||||
Returns whether an user account is expired.
|
||||
|
||||
Args:
|
||||
user_id: The user's ID
|
||||
current_ts: The current timestamp
|
||||
|
||||
Returns:
|
||||
Whether the user account has expired
|
||||
"""
|
||||
expiration_ts = await self.get_expiration_ts_for_user(user_id)
|
||||
return expiration_ts is not None and current_ts >= expiration_ts
|
||||
|
||||
async def set_account_validity_for_user(
|
||||
self,
|
||||
user_id: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue