Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bridge/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,12 @@ func (b *Bmatrix) handleDownloadFile(rmsg *config.Message, content event.Content
// Matrix downloads now have to be authenticated with an access token
// See https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3916-authentication-for-media.md
// Also see: https://github.com/matterbridge-org/matterbridge/issues/36
url = strings.ReplaceAll(url, "mxc://", b.GetString("Server")+"/_matrix/client/v1/media/download/")
default_scheme := ""
server := b.GetString("Server")
if !strings.Contains(server, "://") {
default_scheme = "https://"
}
url = strings.ReplaceAll(url, "mxc://", default_scheme + server + "/_matrix/client/v1/media/download/")

if info, ok = content.Raw["info"].(map[string]any); !ok {
return fmt.Errorf("info isn't a %T", info)
Expand Down