From 3ec67ed434e27448cdd46d92719980a8c44dbdde Mon Sep 17 00:00:00 2001 From: Helder Ferreira Date: Wed, 29 Dec 2021 14:25:12 +0000 Subject: [PATCH] make the bridge homeserver the default on via key space state --- portal.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/portal.go b/portal.go index c6811ec..3c4d04c 100644 --- a/portal.go +++ b/portal.go @@ -1141,7 +1141,7 @@ func (portal *Portal) CreateMatrixRoom(user *User, groupInfo *types.GroupInfo, i portal.ensureUserInvited(user) user.syncChatDoublePuppetDetails(portal, true) - portal.addToSpace(user.getSpaceRoom(), portal.MXID) + portal.addToSpace(user.getSpaceRoom(), portal.MXID, portal.bridge.Config.Homeserver.Domain) if groupInfo != nil { portal.SyncParticipants(user, groupInfo) @@ -1178,12 +1178,13 @@ func (portal *Portal) CreateMatrixRoom(user *User, groupInfo *types.GroupInfo, i return nil } -func (portal *Portal) addToSpace(spaceID id.RoomID, portalID id.RoomID) { +func (portal *Portal) addToSpace(spaceID id.RoomID, portalID id.RoomID, homeserverDomain string) { parentSpaceContent := make(map[string]interface{}) - parentSpaceContent["via"] = []string{"matrix.wounn.xyz"} + parentSpaceContent["via"] = []string{homeserverDomain} + + portal.log.Debugfln("adding room %s to the space %s", portalID, spaceID) - portal.log.Errorln("adding room " + portalID + " to the space " + spaceID) portal.MainIntent().SendStateEvent(spaceID, event.Type{Type: "m.space.child", Class: event.StateEventType}, portalID.String(), parentSpaceContent) }