msgconv: bridge outgoing replies

This commit is contained in:
Skip R
2025-12-17 18:21:57 -08:00
parent 09414cb59d
commit 2cacd4ec81
2 changed files with 9 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ func capID() string {
var discordCaps = &event.RoomFeatures{
ID: capID(),
Reply: event.CapLevelFullySupported,
Formatting: event.FormattingFeatureMap{
event.FmtBold: event.CapLevelFullySupported,
event.FmtItalic: event.CapLevelFullySupported,

View File

@@ -68,6 +68,13 @@ func (mc *MessageConverter) ToDiscord(
var req discordgo.MessageSend
req.Nonce = generateMessageNonce()
if msg.ReplyTo != nil {
req.Reference = &discordgo.MessageReference{
ChannelID: string(msg.ReplyTo.Room.ID),
MessageID: string(msg.ReplyTo.ID),
}
}
switch msg.Content.MsgType {
case event.MsgText, event.MsgEmote, event.MsgNotice:
req.Content, req.AllowedMentions = mc.convertMatrixMessageContent(ctx, msg.Portal, msg.Content, parseAllowedLinkPreviews(msg.Event.Content.Raw))