Add external URL to m.bridge channel object

This commit is contained in:
Tulir Asokan 2022-06-27 10:54:00 +03:00
parent 21269d91dd
commit 2ae6392807

View file

@ -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
}