aboutsummaryrefslogtreecommitdiff
path: root/matrix/matrix.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-22 22:06:48 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-22 22:06:49 +0300
commit14903e0cdcd3ba78face2cbe0ad0287da269a1ea (patch)
tree664fd5cec84d1728bc704a31955ae03bfe9d32ea /matrix/matrix.go
parent4849ef08b861ee5886f879c320ee6e1d8169f139 (diff)
Add bare mode and fix terminal resize bug. Fixes #48
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
}