forked from mirror/mautrix-discord
Add external URL to m.bridge channel object
This commit is contained in:
parent
21269d91dd
commit
2ae6392807
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue