Bridge v0.7.7, bridge.direct_media left at its default (enabled: false).
Animated stickers arrive in Matrix as m.sticker events with no url and no file. Element Web logs Invalid file provided: cannot determine MXC URI. Has it been redacted? from prepEventContentAsMedia() and renders "Can't load this message (m.sticker)" for those events. Static PNG stickers in the same rooms bridge fine.
convertDiscordSticker in portal_convert.go:
mxc := portal.bridge.DMA.StickerMXC(sticker.ID, sticker.FormatType)
// TODO add config option to use direct media even for lottie stickers
if mxc.IsEmpty() && mime != "application/json" {
content = portal.convertDiscordFile(ctx, "sticker", intent, sticker.ID, sticker.URL(), content)
} else {
content.URL = mxc.CUString()
}
For a Lottie sticker (mime == "application/json") that condition is false either way: with direct media enabled mxc is not empty, and with it disabled mime is application/json. So Lottie always takes the else branch. With direct media disabled StickerMXC returns an empty ContentURI, CUString() on that is "", and URL is tagged json:"url,omitempty", so no url reaches the event. With direct media enabled the same branch instead points clients at Discord's raw Lottie .json. convertLottie is unreachable, so animated_sticker.target/args currently have no effect.
This changed in d0e3d29 (#135). v0.6.5 used portal.bridge.Config.Bridge.MediaPatterns.Sticker(sticker.ID, ext) with a plain if mxc.IsEmpty(); v0.7.0 swapped in DMA.StickerMXC() and added the mime != "application/json" clause.
The affected stickers are Lottie: resolving their IDs directly, cdn.discordapp.com/stickers/<id>.json returns application/json while the same IDs 404 on .png.
Bridge v0.7.7,
bridge.direct_medialeft at its default (enabled: false).Animated stickers arrive in Matrix as
m.stickerevents with nourland nofile. Element Web logsInvalid file provided: cannot determine MXC URI. Has it been redacted?fromprepEventContentAsMedia()and renders "Can't load this message (m.sticker)" for those events. Static PNG stickers in the same rooms bridge fine.convertDiscordStickerin portal_convert.go:For a Lottie sticker (
mime == "application/json") that condition is false either way: with direct media enabledmxcis not empty, and with it disabledmimeisapplication/json. So Lottie always takes theelsebranch. With direct media disabledStickerMXCreturns an emptyContentURI,CUString()on that is"", andURLis taggedjson:"url,omitempty", so no url reaches the event. With direct media enabled the same branch instead points clients at Discord's raw Lottie.json.convertLottieis unreachable, soanimated_sticker.target/argscurrently have no effect.This changed in d0e3d29 (#135). v0.6.5 used
portal.bridge.Config.Bridge.MediaPatterns.Sticker(sticker.ID, ext)with a plainif mxc.IsEmpty(); v0.7.0 swapped inDMA.StickerMXC()and added themime != "application/json"clause.The affected stickers are Lottie: resolving their IDs directly,
cdn.discordapp.com/stickers/<id>.jsonreturnsapplication/jsonwhile the same IDs 404 on.png.