From f58be0d1c1236a6a07a6917f3258a5608e1364f8 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 15 Feb 2018 23:18:58 +0100 Subject: [PATCH] Add SHA to FileInfo --- bridge/config/config.go | 1 + gateway/gateway.go | 1 + 2 files changed, 2 insertions(+) diff --git a/bridge/config/config.go b/bridge/config/config.go index d75d3e18..1cf0b9f5 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -41,6 +41,7 @@ type FileInfo struct { URL string Size int64 Avatar bool + SHA string } type ChannelInfo struct { diff --git a/gateway/gateway.go b/gateway/gateway.go index 3d0a61ed..c16264a2 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -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")