aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/query
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-11-15 15:05:23 +0000
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-11-15 15:05:23 +0000
commit6650712a1c0dec282b47b7ba14bc8c2e06a385d8 (patch)
tree12ca755c5c33d3489417f9355dda3f1b7983c779 /roomserver/internal/query
parentf4ee3977340c84d321767d347795b1dcd05ac459 (diff)
Federation fixes for virtual hosting
Diffstat (limited to 'roomserver/internal/query')
-rw-r--r--roomserver/internal/query/query.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go
index 8850e5c4..d8456fb4 100644
--- a/roomserver/internal/query/query.go
+++ b/roomserver/internal/query/query.go
@@ -37,10 +37,10 @@ import (
)
type Queryer struct {
- DB storage.Database
- Cache caching.RoomServerCaches
- ServerName gomatrixserverlib.ServerName
- ServerACLs *acls.ServerACLs
+ DB storage.Database
+ Cache caching.RoomServerCaches
+ IsLocalServerName func(gomatrixserverlib.ServerName) bool
+ ServerACLs *acls.ServerACLs
}
// QueryLatestEventsAndState implements api.RoomserverInternalAPI
@@ -392,7 +392,7 @@ func (r *Queryer) QueryServerJoinedToRoom(
}
response.RoomExists = true
- if request.ServerName == r.ServerName || request.ServerName == "" {
+ if r.IsLocalServerName(request.ServerName) || request.ServerName == "" {
response.IsInRoom, err = r.DB.GetLocalServerInRoom(ctx, info.RoomNID)
if err != nil {
return fmt.Errorf("r.DB.GetLocalServerInRoom: %w", err)