4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 04:09:24 +00:00

Download files from slack and reupload to mattermost (slack/mattermost). Closes #255

Refactor message.Extra to a map[string][]interface{} to have a bit more flexibility
for stuffing extra stuff.

For attached files from slack, files < 1MB size get downloaded (in memory), and get
put into Extra["file"][]config.FileInfo (containing a pointer to the buffer and
the filename). This is not async so slack channels with lots of attached files
may suffer a slowdown. (the download timeout is set at 5 seconds).
This commit is contained in:
Wim
2017-09-21 22:35:21 +02:00
parent 6a7adb20a8
commit c4b75e5754
4 changed files with 65 additions and 8 deletions

View File

@ -29,7 +29,12 @@ type Message struct {
Gateway string `json:"gateway"`
Timestamp time.Time `json:"timestamp"`
ID string `json:"id"`
Extra []interface{}
Extra map[string][]interface{}
}
type FileInfo struct {
Name string
Data *[]byte
}
type ChannelInfo struct {