mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-10 06:20:28 +00:00
Add SHA to FileInfo
This commit is contained in:
parent
1152394bc1
commit
f58be0d1c1
@ -41,6 +41,7 @@ type FileInfo struct {
|
|||||||
URL string
|
URL string
|
||||||
Size int64
|
Size int64
|
||||||
Avatar bool
|
Avatar bool
|
||||||
|
SHA string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChannelInfo struct {
|
type ChannelInfo struct {
|
||||||
|
@ -362,6 +362,7 @@ func (gw *Gateway) handleFiles(msg *config.Message) {
|
|||||||
durl := gw.Config.General.MediaServerDownload + "/" + sha1sum + "/" + fi.Name
|
durl := gw.Config.General.MediaServerDownload + "/" + sha1sum + "/" + fi.Name
|
||||||
extra := msg.Extra["file"][i].(config.FileInfo)
|
extra := msg.Extra["file"][i].(config.FileInfo)
|
||||||
extra.URL = durl
|
extra.URL = durl
|
||||||
|
extra.SHA = sha1sum
|
||||||
msg.Extra["file"][i] = extra
|
msg.Extra["file"][i] = extra
|
||||||
req, _ := http.NewRequest("PUT", url, reader)
|
req, _ := http.NewRequest("PUT", url, reader)
|
||||||
req.Header.Set("Content-Type", "binary/octet-stream")
|
req.Header.Set("Content-Type", "binary/octet-stream")
|
||||||
|
Loading…
Reference in New Issue
Block a user