aboutsummaryrefslogtreecommitdiff
path: root/matrix/matrix.go
diff options
context:
space:
mode:
Diffstat (limited to 'matrix/matrix.go')
-rw-r--r--matrix/matrix.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index c79f8fd..254b212 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -579,12 +579,15 @@ func (c *Container) Download(mxcURL string) (data []byte, hs, id string, err err
return
}
-func (c *Container) download(hs, id, cacheFile string) (data []byte, err error) {
+func (c *Container) GetDownloadURL(hs, id string) string {
dlURL, _ := url.Parse(c.client.HomeserverURL.String())
dlURL.Path = path.Join(dlURL.Path, "/_matrix/media/v1/download", hs, id)
+ return dlURL.String()
+}
+func (c *Container) download(hs, id, cacheFile string) (data []byte, err error) {
var resp *http.Response
- resp, err = c.client.Client.Get(dlURL.String())
+ resp, err = c.client.Client.Get(c.GetDownloadURL(hs, id))
if err != nil {
return
}