Skip to content

Commit

Permalink
only add url field on sticker events
Browse files Browse the repository at this point in the history
  • Loading branch information
surakin committed Jan 2, 2024
1 parent c9175c3 commit 598e6e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3434,7 +3434,12 @@ func (portal *Portal) uploadMedia(intent *appservice.IntentAPI, data []byte, con
if file != nil {
file.URL = mxc.CUString()
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 {
content.URL = mxc.CUString()
}
Expand Down

0 comments on commit 598e6e6

Please sign in to comment.