Add SHA to FileInfo

This commit is contained in:
Wim 2018-02-15 23:18:58 +01:00
parent 1152394bc1
commit f58be0d1c1
2 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ type FileInfo struct {
URL string
Size int64
Avatar bool
SHA string
}
type ChannelInfo struct {

View File

@ -362,6 +362,7 @@ func (gw *Gateway) handleFiles(msg *config.Message) {
durl := gw.Config.General.MediaServerDownload + "/" + sha1sum + "/" + fi.Name
extra := msg.Extra["file"][i].(config.FileInfo)
extra.URL = durl
extra.SHA = sha1sum
msg.Extra["file"][i] = extra
req, _ := http.NewRequest("PUT", url, reader)
req.Header.Set("Content-Type", "binary/octet-stream")