From 2ae63928077c4bb000511e6b574414d3f963fea4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 27 Jun 2022 10:54:00 +0300 Subject: [PATCH] Add external URL to m.bridge channel object --- portal.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/portal.go b/portal.go index c970039..d974f8f 100644 --- a/portal.go +++ b/portal.go @@ -246,6 +246,7 @@ func (portal *Portal) getBridgeInfo() (string, event.BridgeEventContent) { var bridgeInfoStateKey string if portal.GuildID == "" { bridgeInfoStateKey = fmt.Sprintf("fi.mau.discord://discord/dm/%s", portal.Key.ChannelID) + bridgeInfo.Channel.ExternalURL = fmt.Sprintf("https://discord.com/channels/@me/%s", portal.Key.ChannelID) } else { bridgeInfo.Network = &event.BridgeInfoSection{ ID: portal.GuildID, @@ -256,6 +257,7 @@ func (portal *Portal) getBridgeInfo() (string, event.BridgeEventContent) { // TODO is it possible to find the URL? } bridgeInfoStateKey = fmt.Sprintf("fi.mau.discord://discord/%s/%s", portal.GuildID, portal.Key.ChannelID) + bridgeInfo.Channel.ExternalURL = fmt.Sprintf("https://discord.com/channels/%s/%s", portal.GuildID, portal.Key.ChannelID) } return bridgeInfoStateKey, bridgeInfo }