Move MakeJoin logic to GMSL (#3081)

This commit is contained in:
devonh 2023-05-17 00:33:27 +00:00 committed by GitHub
parent 0489d16f95
commit 67d6876857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 1158 additions and 494 deletions

View file

@ -145,7 +145,7 @@ func (r *Joiner) performJoinRoomByAlias(
return r.performJoinRoomByID(ctx, req)
}
// TODO: Break this function up a bit
// TODO: Break this function up a bit & move to GMSL
// nolint:gocyclo
func (r *Joiner) performJoinRoomByID(
ctx context.Context,
@ -286,7 +286,7 @@ func (r *Joiner) performJoinRoomByID(
}
event, err := eventutil.QueryAndBuildEvent(ctx, &proto, r.Cfg.Matrix, identity, time.Now(), r.RSAPI, &buildRes)
switch err {
switch err.(type) {
case nil:
// The room join is local. Send the new join event into the
// roomserver. First of all check that the user isn't already
@ -328,7 +328,7 @@ func (r *Joiner) performJoinRoomByID(
// Otherwise we'll try a federated join as normal, since it's quite
// possible that the room still exists on other servers.
if len(req.ServerNames) == 0 {
return "", "", eventutil.ErrRoomNoExists
return "", "", eventutil.ErrRoomNoExists{}
}
}