From 14903e0cdcd3ba78face2cbe0ad0287da269a1ea Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 22 May 2018 22:06:48 +0300 Subject: Add bare mode and fix terminal resize bug. Fixes #48 --- matrix/matrix.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'matrix') 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 } -- cgit v1.2.3