From 6e7b8afafa6a50be0e9d8a2b9a5e25e5592c918f Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Mon, 29 Apr 2024 12:36:22 -0700 Subject: [PATCH] requested changes --- changelog.d/17051.feature | 2 +- synapse/storage/databases/main/registration.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.d/17051.feature b/changelog.d/17051.feature index b8e9870965d..1c41f49f7d3 100644 --- a/changelog.d/17051.feature +++ b/changelog.d/17051.feature @@ -1 +1 @@ -Add preliminary support for MSC3823 - Account Suspension. \ No newline at end of file +Add preliminary support for [MSC3823](https://github.com/matrix-org/matrix-spec-proposals/pull/3823) - Account Suspension. \ No newline at end of file diff --git a/synapse/storage/databases/main/registration.py b/synapse/storage/databases/main/registration.py index afdf6e7536b..df7f8a43b70 100644 --- a/synapse/storage/databases/main/registration.py +++ b/synapse/storage/databases/main/registration.py @@ -237,7 +237,7 @@ def get_user_by_id_txn(txn: LoggingTransaction) -> Optional[UserInfo]: deactivated, COALESCE(shadow_banned, FALSE) AS shadow_banned, COALESCE(approved, TRUE) AS approved, COALESCE(locked, FALSE) AS locked, - COALESCE(suspended, FALSE) AS suspended + suspended FROM users WHERE name = ? """, @@ -1190,7 +1190,8 @@ async def get_user_suspended_status(self, user_id: str) -> bool: Args: user_id: The user ID of the user in question Returns: - True if the user's account is suspended, false if not. + True if the user's account is suspended, false if it is not suspended or + if the user ID cannot be found. """ res = await self.db_pool.simple_select_one_onecol(