From ac338ee7228bcf89efeb0996148386f4f8c227a8 Mon Sep 17 00:00:00 2001 From: Skip R Date: Wed, 14 Jan 2026 17:52:06 -0800 Subject: [PATCH] msgconv: correctly bridge attachments and embeds `URL` needs to be set if the room/attachment is unencrypted; otherwise, `File` needs to be set. --- pkg/msgconv/from-discord.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/msgconv/from-discord.go b/pkg/msgconv/from-discord.go index a0cdcc5..58511fc 100644 --- a/pkg/msgconv/from-discord.go +++ b/pkg/msgconv/from-discord.go @@ -289,7 +289,11 @@ func (mc *MessageConverter) renderDiscordVideoEmbed(ctx context.Context, intent MimeType: reupload.MimeType, Size: reupload.DownloadedSize, }, - File: reupload.EncryptedFile, + } + if reupload.EncryptedFile != nil { + content.File = reupload.EncryptedFile + } else { + content.URL = reupload.MXC } if embed.Video != nil { @@ -570,8 +574,11 @@ func (mc *MessageConverter) renderDiscordAttachment(ctx context.Context, intent content.Info.Width = att.Width content.Info.Height = att.Height } - content.URL = reupload.MXC - content.File = reupload.EncryptedFile + if reupload.EncryptedFile != nil { + content.File = reupload.EncryptedFile + } else { + content.URL = reupload.MXC + } return &bridgev2.ConvertedMessagePart{ Type: event.EventMessage,