summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Teller <D.O.Teller@gmail.com>2022-05-27 15:13:29 +0200
committerGitHub <noreply@github.com>2022-05-27 13:13:29 +0000
commit888eb736a15035c94676eb60da6b6fabb642e252 (patch)
tree68c18efcdcebc89ad40028283ea0c99b1560a3b5
parentClean-up some receipts code (#12888) (diff)
downloadsynapse-888eb736a15035c94676eb60da6b6fabb642e252.tar.xz
Add code M_USER_ACCOUNT_SUSPENDED, as per MSC3823. (#12845)
Signed-off-by: David Teller <davidt@element.io>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
-rw-r--r--changelog.d/12845.feature1
-rw-r--r--synapse/api/errors.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/changelog.d/12845.feature b/changelog.d/12845.feature
new file mode 100644
index 0000000000..628fb16d08
--- /dev/null
+++ b/changelog.d/12845.feature
@@ -0,0 +1 @@
+Support the new error code "M_ORG_MATRIX_MSC3823_USER_ACCOUNT_SUSPENDED" from [MSC3823](https://github.com/matrix-org/matrix-spec-proposals/pull/3823).
\ No newline at end of file
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 6650e826d5..05e96843cf 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -79,6 +79,13 @@ class Codes(str, Enum):
     WEAK_PASSWORD = "M_WEAK_PASSWORD"
     INVALID_SIGNATURE = "M_INVALID_SIGNATURE"
     USER_DEACTIVATED = "M_USER_DEACTIVATED"
+
+    # The account has been suspended on the server.
+    # By opposition to `USER_DEACTIVATED`, this is a reversible measure
+    # that can possibly be appealed and reverted.
+    # Part of MSC3823.
+    USER_ACCOUNT_SUSPENDED = "M_ORG_MATRIX_MSC3823_USER_ACCOUNT_SUSPENDED"
+
     BAD_ALIAS = "M_BAD_ALIAS"
     # For restricted join rules.
     UNABLE_AUTHORISE_JOIN = "M_UNABLE_TO_AUTHORISE_JOIN"