diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-05-25 10:05:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 10:05:30 +0100 |
commit | 81843e8836e6f8f334c7b5fd1433c427c10a9443 (patch) | |
tree | da86bc862d46103b955431961df95fab90c199b6 /clientapi/jsonerror | |
parent | d621dd2986fa0b8cce9d164a7249456d0be47c81 (diff) |
Restricted join support on `/make_join`, `/send_join` (#2478)
* Add `QueryRestrictedJoinAllowed`
* Add `Resident` flag to `QueryRestrictedJoinAllowedResponse`
* Check restricted joins on federation API
* Return `Restricted` to determine if the room was restricted or not
* Populate `AuthorisedVia` properly
* Sign the event on `/send_join`, return it in the `/send_join` response in the `"event"` key
* Kick back joins with invalid authorising user IDs, use event from `"event"` key if returned in `RespSendJoin`
* Use invite helper in `QueryRestrictedJoinAllowed`
* Only use users with the power to invite, change error bubbling a bit
* Placate the almighty linter
One day I will nuke `gocyclo` from orbit and everything in the world will be much better for it.
* Review comments
Diffstat (limited to 'clientapi/jsonerror')
-rw-r--r-- | clientapi/jsonerror/jsonerror.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clientapi/jsonerror/jsonerror.go b/clientapi/jsonerror/jsonerror.go index 1fc1c0c0..70bac61d 100644 --- a/clientapi/jsonerror/jsonerror.go +++ b/clientapi/jsonerror/jsonerror.go @@ -154,6 +154,12 @@ func MissingParam(msg string) *MatrixError { return &MatrixError{"M_MISSING_PARAM", msg} } +// UnableToAuthoriseJoin is an error that is returned when a server can't +// determine whether to allow a restricted join or not. +func UnableToAuthoriseJoin(msg string) *MatrixError { + return &MatrixError{"M_UNABLE_TO_AUTHORISE_JOIN", msg} +} + // LeaveServerNoticeError is an error returned when trying to reject an invite // for a server notice room. func LeaveServerNoticeError() *MatrixError { |