mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-06-02 19:19:11 +02:00
only add url field on sticker events
This commit is contained in:
parent
c9175c3f36
commit
598e6e68fc
|
@ -3434,7 +3434,12 @@ func (portal *Portal) uploadMedia(intent *appservice.IntentAPI, data []byte, con
|
||||||
if file != nil {
|
if file != nil {
|
||||||
file.URL = mxc.CUString()
|
file.URL = mxc.CUString()
|
||||||
content.File = file
|
content.File = file
|
||||||
content.URL = mxc.CUString()
|
// Sticker events require the URL field to be present https://spec.matrix.org/v1.9/client-server-api/#events-16
|
||||||
|
// This seems to affect only clients based on the Rust SDK on encrypted channels (like Element X)
|
||||||
|
isSticker := string(content.MsgType) == event.EventSticker.Type
|
||||||
|
if isSticker {
|
||||||
|
content.URL = mxc.CUString()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
content.URL = mxc.CUString()
|
content.URL = mxc.CUString()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue