diff options
author | Will Hunt <will@half-shot.uk> | 2021-03-03 17:00:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 17:00:31 +0000 |
commit | 9557ccada4efe50d0f370019ad0b9f017fc7ebcf (patch) | |
tree | 8f0d52d793180ce05b9235bdd1da10ee3a7d76ef /federationapi | |
parent | a2773922d2fe40e6d95d73f532640702709ab526 (diff) |
Fix appsevice alias queries part 2 (#1684)
* Check membership of room
* Use QueryStateAfterEventsResponse
* Fix complexity
* Add field ShouldHitAppservice to GetRoomIDForAlias
* Hit appservice when trying to join a non-existent alias
* remove unused
* Changes that I made a long time ago
* Rename to appserviceJoinedAtEvent
* Check membership in GetMemberships
* Update QueryMembershipsForRoom
* Tweaks in client API
* Update appserviceJoinedAtEvent
* Comments
* Try QueryMembershipForUser instead
* Undo some changes to client API that shouldn't be needed
* More /event tweaks
* Refactor /event bit
* Go back to QueryMembershipsForRoom because appservices are hard
* Fix bugs in onMessage
* Add comments
* More logical naming, clean up a bit
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'federationapi')
-rw-r--r-- | federationapi/routing/query.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/federationapi/routing/query.go b/federationapi/routing/query.go index 6c25b4d3..b4158f0c 100644 --- a/federationapi/routing/query.go +++ b/federationapi/routing/query.go @@ -53,9 +53,12 @@ func RoomAliasToID( var resp gomatrixserverlib.RespDirectory if domain == cfg.Matrix.ServerName { - queryReq := roomserverAPI.GetRoomIDForAliasRequest{Alias: roomAlias} - var queryRes roomserverAPI.GetRoomIDForAliasResponse - if err = rsAPI.GetRoomIDForAlias(httpReq.Context(), &queryReq, &queryRes); err != nil { + queryReq := &roomserverAPI.GetRoomIDForAliasRequest{ + Alias: roomAlias, + IncludeAppservices: true, + } + queryRes := &roomserverAPI.GetRoomIDForAliasResponse{} + if err = rsAPI.GetRoomIDForAlias(httpReq.Context(), queryReq, queryRes); err != nil { util.GetLogger(httpReq.Context()).WithError(err).Error("aliasAPI.GetRoomIDForAlias failed") return jsonerror.InternalServerError() } |