Skip to content

Commit f990cb3

Browse files
authored
Report AS-exclusive localparts as used, not an error (#4723)
2 parents b4c3de4 + 59f133c commit f990cb3

File tree

1 file changed

+5
-1
lines changed
  • crates/matrix-synapse/src

1 file changed

+5
-1
lines changed

crates/matrix-synapse/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const M_USER_IN_USE: &str = "M_USER_IN_USE";
2323
/// Encountered when trying to register a user ID which is not valid.
2424
/// — <https://spec.matrix.org/v1.10/client-server-api/#other-error-codes>
2525
const M_INVALID_USERNAME: &str = "M_INVALID_USERNAME";
26+
/// Encountered when trying to register a user ID reserved by an appservice.
27+
/// — <https://spec.matrix.org/v1.10/client-server-api/#other-error-codes>
28+
const M_EXCLUSIVE: &str = "M_EXCLUSIVE";
2629

2730
mod error;
2831

@@ -241,7 +244,8 @@ impl HomeserverConnection for SynapseConnection {
241244

242245
Err(err)
243246
if err.errcode() == Some(M_INVALID_USERNAME)
244-
|| err.errcode() == Some(M_USER_IN_USE) =>
247+
|| err.errcode() == Some(M_USER_IN_USE)
248+
|| err.errcode() == Some(M_EXCLUSIVE) =>
245249
{
246250
debug!(
247251
error = &err as &dyn std::error::Error,

0 commit comments

Comments
 (0)