From 5a910a04533d8f762df760c6455035a9581427b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 19 Nov 2022 17:38:45 +0100 Subject: [PATCH] Correct the expected space id for channels in categories --- matrix/mautrix-discord/no-category-spaces.patch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/matrix/mautrix-discord/no-category-spaces.patch b/matrix/mautrix-discord/no-category-spaces.patch index ca6f67a..e9a7609 100644 --- a/matrix/mautrix-discord/no-category-spaces.patch +++ b/matrix/mautrix-discord/no-category-spaces.patch @@ -1,5 +1,5 @@ diff --git a/portal.go b/portal.go -index 25e0dc2..7a14a3d 100644 +index 25e0dc2..9f6a5b3 100644 --- a/portal.go +++ b/portal.go @@ -351,7 +351,7 @@ func (portal *Portal) CreateMatrixRoom(user *User, channel *discordgo.Channel) e @@ -11,7 +11,7 @@ index 25e0dc2..7a14a3d 100644 } if !portal.bridge.Config.Bridge.FederateRooms { creationContent["m.federate"] = false -@@ -1777,11 +1777,7 @@ func (portal *Portal) UpdateParent(parentID string) bool { +@@ -1777,18 +1777,12 @@ func (portal *Portal) UpdateParent(parentID string) bool { } portal.log.Debugfln("Updating parent ID %q -> %q", portal.ParentID, parentID) portal.ParentID = parentID @@ -24,3 +24,11 @@ index 25e0dc2..7a14a3d 100644 return true } + func (portal *Portal) ExpectedSpaceID() id.RoomID { +- if portal.Parent != nil { +- return portal.Parent.MXID +- } else if portal.Guild != nil { ++ if portal.Guild != nil { + return portal.Guild.MXID + } + return ""