Restricted joins — again

This commit is contained in:
Neil Alexander 2021-11-15 16:17:38 +00:00
parent 5565e40395
commit bf2ce6325a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
6 changed files with 595 additions and 25 deletions

View file

@ -149,6 +149,18 @@ func MissingParam(msg string) *MatrixError {
return &MatrixError{"M_MISSING_PARAM", msg}
}
// UnableToAuthoriseJoin is an error that is returned when a server that we
// are trying to join via doesn't know enough to authorise a restricted join.
func UnableToAuthoriseJoin(msg string) *MatrixError {
return &MatrixError{"M_UNABLE_TO_AUTHORISE_JOIN", msg}
}
// UnableToGrantJoin is an error that is returned when a server that we
// are trying to join via doesn't have a user with power to invite.
func UnableToGrantJoin(msg string) *MatrixError {
return &MatrixError{"M_UNABLE_TO_GRANT_JOIN", msg}
}
type IncompatibleRoomVersionError struct {
RoomVersion string `json:"room_version"`
Error string `json:"error"`
@ -161,7 +173,7 @@ func IncompatibleRoomVersion(roomVersion gomatrixserverlib.RoomVersion) *Incompa
return &IncompatibleRoomVersionError{
Code: "M_INCOMPATIBLE_ROOM_VERSION",
RoomVersion: string(roomVersion),
Error: "Your homeserver does not support the features required to join this room",
Error: fmt.Sprintf("Your homeserver does not support the features required to join this version %q room", roomVersion),
}
}