Add bare mode and fix terminal resize bug. Fixes #48

This commit is contained in:
Tulir Asokan
2018-05-22 22:06:48 +03:00
parent 4849ef08b8
commit 14903e0cdc
13 changed files with 158 additions and 86 deletions

View File

@ -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
}