File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -569,7 +569,8 @@ func (b *Bmatrix) handleDownloadFile(rmsg *config.Message, content map[string]in
569569 if url , ok = content ["url" ].(string ); ! ok {
570570 return fmt .Errorf ("url isn't a %T" , url )
571571 }
572- url = strings .Replace (url , "mxc://" , b .GetString ("Server" )+ "/_matrix/media/v1/download/" , - 1 )
572+ // https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3916-authentication-for-media.md
573+ url = strings .Replace (url , "mxc://" , b .GetString ("Server" )+ "/_matrix/client/v1/media/download/" , - 1 )
573574
574575 if info , ok = content ["info" ].(map [string ]interface {}); ! ok {
575576 return fmt .Errorf ("info isn't a %T" , info )
@@ -606,7 +607,7 @@ func (b *Bmatrix) handleDownloadFile(rmsg *config.Message, content map[string]in
606607 return err
607608 }
608609 // actually download the file
609- data , err := helper .DownloadFile (url )
610+ data , err := helper .DownloadFileAuth (url , "Bearer " + b . mc . AccessToken )
610611 if err != nil {
611612 return fmt .Errorf ("download %s failed %#v" , url , err )
612613 }
You can’t perform that action at this time.
0 commit comments