Commit a304b0834a

a304b0834ac2f16f5a29a9fe583b507ad3aa3ab4

parent: 38e62436d4

Unsigned

Darafei Praliaskouski <me@komzpa.net> · 2026-06-30 15:03 UTC
committer: <strk@kbt.io>

fix: clarify room alias join failures

Layout: unified · split

src/server.rs +14 −4
@@ -252,7 +252,7 @@ impl MatrixServer {
252252 self.print_error(&format!(
253253 "Failed to join {}: {}",
254254 target,
255 format_join_error(&error)
255 format_join_error(&error, &target)
256256 ));
257257 }
258258 }
@@ -462,11 +462,21 @@ impl MatrixServer {
462462 }
463463}
464464
465fn format_join_error(error: &Error) -> String {
466 error
465fn format_join_error(error: &Error, target: &str) -> String {
466 let message = error
467467 .as_client_api_error()
468468 .map(ToString::to_string)
469 .unwrap_or_else(|| error.to_string())
469 .unwrap_or_else(|| error.to_string());
470
471 if target.starts_with('#')
472 && message.contains("Expected RoomID of the form")
473 {
474 format!(
475 "{message}; the alias may point to a room v12 ID without a server part. Update the homeserver/client stack or join from a homeserver that supports room v12."
476 )
477 } else {
478 message
479 }
470480}
471481
472482impl Drop for MatrixServer {