client-api: Add ErrorKind::UserSuspended

According to MSC3823
This commit is contained in:
Kévin Commaille 2024-12-12 11:38:56 +01:00 committed by strawberry
parent 4a9dfc7b30
commit 3ca8adaadf
3 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Improvements:
variable, or inside `.cargo/config.toml`. It can also be enabled by setting
the `RUMA_UNSTABLE_EXHAUSTIVE_TYPES` environment variable.
- Add `ErrorKind::ThreepidMediumNotSupported`, according to MSC4178.
- Add `ErrorKind::UserSuspended`, according to MSC3823.
# 0.19.0

View File

@ -223,6 +223,9 @@ pub enum ErrorKind {
/// M_USER_LOCKED
UserLocked,
/// M_USER_SUSPENDED
UserSuspended,
#[doc(hidden)]
_Custom { errcode: PrivOwnedStr, extra: Extra },
}
@ -305,6 +308,7 @@ impl AsRef<str> for ErrorKind {
#[cfg(feature = "unstable-msc3843")]
Self::Unactionable => "M_UNACTIONABLE",
Self::UserLocked => "M_USER_LOCKED",
Self::UserSuspended => "M_USER_SUSPENDED",
Self::_Custom { errcode, .. } => &errcode.0,
}
}

View File

@ -254,6 +254,7 @@ impl<'de> Visitor<'de> for ErrorKindVisitor {
#[cfg(feature = "unstable-msc3843")]
ErrCode::Unactionable => ErrorKind::Unactionable,
ErrCode::UserLocked => ErrorKind::UserLocked,
ErrCode::UserSuspended => ErrorKind::UserSuspended,
ErrCode::_Custom(errcode) => ErrorKind::_Custom { errcode, extra },
})
}
@ -314,6 +315,7 @@ enum ErrCode {
#[cfg(feature = "unstable-msc3843")]
Unactionable,
UserLocked,
UserSuspended,
_Custom(PrivOwnedStr),
}