Roomserver perform join (#1001)

* Add PerformJoin template

* Try roomserver perform join

* Send correct server name to FS API

* Pass through content, try to handle multiple server names

* Fix local server checks

* Don't refer to non-existent error

* Add directory lookups of aliases

* Remove unneeded parameters

* Don't repeat join events into the roomserver

* Unmarshal the content, that would help

* Check if the user is already in the room in the fedeationapi too

* Return incompatible room version error

* Use Membership, don't try more servers than needed

* Review comments, make FS API take list of servernames, dedupe them, break out of loop properly on success

* Tweaks
This commit is contained in:
Neil Alexander 2020-05-04 13:53:47 +01:00 committed by GitHub
parent 36bbb25561
commit 5c894efd0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 506 additions and 406 deletions

View file

@ -28,6 +28,12 @@ type JoinedHost struct {
ServerName gomatrixserverlib.ServerName
}
type ServerNames []gomatrixserverlib.ServerName
func (s ServerNames) Len() int { return len(s) }
func (s ServerNames) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s ServerNames) Less(i, j int) bool { return s[i] < s[j] }
// A EventIDMismatchError indicates that we have got out of sync with the
// room server.
type EventIDMismatchError struct {