From f468c0671e2b64635b243061a0717ce3a592b1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 19 Nov 2022 10:38:22 +0100 Subject: [PATCH] Disable creating spaces for categories --- .../mautrix-discord/no-category-spaces.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 matrix/mautrix-discord/no-category-spaces.patch diff --git a/matrix/mautrix-discord/no-category-spaces.patch b/matrix/mautrix-discord/no-category-spaces.patch new file mode 100644 index 0000000..ca6f67a --- /dev/null +++ b/matrix/mautrix-discord/no-category-spaces.patch @@ -0,0 +1,26 @@ +diff --git a/portal.go b/portal.go +index 25e0dc2..7a14a3d 100644 +--- a/portal.go ++++ b/portal.go +@@ -351,7 +351,7 @@ func (portal *Portal) CreateMatrixRoom(user *User, channel *discordgo.Channel) e + + creationContent := make(map[string]interface{}) + if portal.Type == discordgo.ChannelTypeGuildCategory { +- creationContent["type"] = event.RoomTypeSpace ++ return nil + } + if !portal.bridge.Config.Bridge.FederateRooms { + creationContent["m.federate"] = false +@@ -1777,11 +1777,7 @@ func (portal *Portal) UpdateParent(parentID string) bool { + } + portal.log.Debugfln("Updating parent ID %q -> %q", portal.ParentID, parentID) + portal.ParentID = parentID +- if portal.ParentID != "" { +- portal.Parent = portal.bridge.GetPortalByID(database.NewPortalKey(parentID, ""), discordgo.ChannelTypeGuildCategory) +- } else { +- portal.Parent = nil +- } ++ portal.Parent = nil + return true + } +