Add SHA to FileInfo

pull/390/head
Wim 7 years ago
parent 1152394bc1
commit f58be0d1c1

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

@ -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")

Loading…
Cancel
Save