summaryrefslogtreecommitdiffstats
path: root/bridge/msteams/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/msteams/handler.go')
-rw-r--r--bridge/msteams/handler.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/bridge/msteams/handler.go b/bridge/msteams/handler.go
index 3283588a..8cccfe0c 100644
--- a/bridge/msteams/handler.go
+++ b/bridge/msteams/handler.go
@@ -5,6 +5,7 @@ import (
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/bridge/helper"
+ msgraph "github.com/yaegashi/msgraph.go/beta"
)
func (b *Bmsteams) findFile(weburl string) (string, error) {
@@ -44,3 +45,15 @@ func (b *Bmsteams) handleDownloadFile(rmsg *config.Message, filename, weburl str
helper.HandleDownloadData(b.Log, rmsg, filename, comment, weburl, data, b.General)
return nil
}
+
+func (b *Bmsteams) handleAttachments(rmsg *config.Message, msg msgraph.ChatMessage) {
+ for _, a := range msg.Attachments {
+ //remove the attachment tags from the text
+ rmsg.Text = attachRE.ReplaceAllString(rmsg.Text, "")
+ //handle the download
+ err := b.handleDownloadFile(rmsg, *a.Name, *a.ContentURL)
+ if err != nil {
+ b.Log.Errorf("download of %s failed: %s", *a.Name, err)
+ }
+ }
+}