client-api: Add M_DUPLICATE_ANNOTATION error kind

According to MSC2677
This commit is contained in:
Kévin Commaille 2023-04-26 15:53:37 +02:00 committed by Kévin Commaille
parent cb512f01d6
commit af2407e98a
2 changed files with 10 additions and 0 deletions

View File

@ -150,6 +150,10 @@ pub enum ErrorKind {
/// M_BAD_ALIAS
BadAlias,
/// M_DUPLICATE_ANNOTATION
#[cfg(feature = "unstable-msc2677")]
DuplicateAnnotation,
/// FI.MAU.MSC2246_NOT_YET_UPLOADED
#[cfg(feature = "unstable-msc2246")]
NotYetUploaded,
@ -209,6 +213,8 @@ impl AsRef<str> for ErrorKind {
Self::UnableToAuthorizeJoin => "M_UNABLE_TO_AUTHORISE_JOIN",
Self::UnableToGrantJoin => "M_UNABLE_TO_GRANT_JOIN",
Self::BadAlias => "M_BAD_ALIAS",
#[cfg(feature = "unstable-msc2677")]
Self::DuplicateAnnotation => "M_DUPLICATE_ANNOTATION",
#[cfg(feature = "unstable-msc2246")]
Self::NotYetUploaded => "FI.MAU.MSC2246_NOT_YET_UPLOADED",
#[cfg(feature = "unstable-msc2246")]

View File

@ -206,6 +206,8 @@ impl<'de> Visitor<'de> for ErrorKindVisitor {
},
ErrCode::CannotLeaveServerNoticeRoom => ErrorKind::CannotLeaveServerNoticeRoom,
ErrCode::WeakPassword => ErrorKind::WeakPassword,
#[cfg(feature = "unstable-msc2677")]
ErrCode::DuplicateAnnotation => ErrorKind::DuplicateAnnotation,
#[cfg(feature = "unstable-msc2246")]
ErrCode::NotYetUploaded => ErrorKind::NotYetUploaded,
#[cfg(feature = "unstable-msc2246")]
@ -253,6 +255,8 @@ enum ErrCode {
ResourceLimitExceeded,
CannotLeaveServerNoticeRoom,
WeakPassword,
#[cfg(feature = "unstable-msc2677")]
DuplicateAnnotation,
#[cfg(feature = "unstable-msc2246")]
#[ruma_enum(rename = "FI.MAU.MSC2246_NOT_YET_UPLOADED", alias = "M_NOT_YET_UPLOADED")]
NotYetUploaded,