commit f73bbca10b291d2ceb28f478fa035b0a375e450d
Author: Wim <wim@42.be>
Date: Sun Nov 25 00:23:42 2018 +0000
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index 307a902..ad48edf 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -38911 +38916 @@ func (b *Bslack) uploadFile(msg *config.Message, channelID string) {
ts := time.Now()
b.Log.Debugf("Adding file %s to cache at %s with timestamp", fi.Name, ts.String())
b.cache.Add("filename"+fi.Name, ts)
+ initialComment := fmt.Sprintf("File from %s", msg.Username)
+ if fi.Comment != "" {
+ initialComment += fmt.Sprintf("with comment: %s", fi.Comment)
+ }
res, err := b.sc.UploadFile(slack.FileUploadParameters{
- Reader: bytes.NewReader(*fi.Data),
- Filename: fi.Name,
- Channels: []string{channelID},
- InitialComment: fi.Comment,
+ Reader: bytes.NewReader(*fi.Data),
+ Filename: fi.Name,
+ Channels: []string{channelID},
+ InitialComment: initialComment,
+ ThreadTimestamp: msg.ParentID,
})
if err != nil {
b.Log.Errorf("uploadfile %#v", err)