mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-27 06:40:50 -04:00
Optionally include account validity in MSC3720 account status responses (#12266)
This commit is contained in:
parent
e78d4f61fc
commit
5436b014f4
4 changed files with 73 additions and 1 deletions
|
@ -26,6 +26,10 @@ class AccountHandler:
|
|||
self._main_store = hs.get_datastores().main
|
||||
self._is_mine = hs.is_mine
|
||||
self._federation_client = hs.get_federation_client()
|
||||
self._use_account_validity_in_account_status = (
|
||||
hs.config.server.use_account_validity_in_account_status
|
||||
)
|
||||
self._account_validity_handler = hs.get_account_validity_handler()
|
||||
|
||||
async def get_account_statuses(
|
||||
self,
|
||||
|
@ -106,6 +110,13 @@ class AccountHandler:
|
|||
"deactivated": userinfo.is_deactivated,
|
||||
}
|
||||
|
||||
if self._use_account_validity_in_account_status:
|
||||
status[
|
||||
"org.matrix.expired"
|
||||
] = await self._account_validity_handler.is_user_expired(
|
||||
user_id.to_string()
|
||||
)
|
||||
|
||||
return status
|
||||
|
||||
async def _get_remote_account_statuses(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue