summaryrefslogtreecommitdiffstats
path: root/bridge/slack
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-07-16 18:08:26 +0200
committerWim <wim@42.be>2017-07-16 18:08:26 +0200
commit778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725 (patch)
tree7e2a1017ba7aba0e90835c81a831fccdb2c13418 /bridge/slack
parent835a1ac3a623b5b163fbb8f8700ba1994d83a97c (diff)
downloadmatterbridge-msglm-778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725.tar.gz
matterbridge-msglm-778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725.tar.bz2
matterbridge-msglm-778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725.zip
Add support for fallback/text in attachments (slack)
Diffstat (limited to 'bridge/slack')
-rw-r--r--bridge/slack/slack.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index 101b9017..4f9b7fc7 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -262,6 +262,15 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
}
m.Channel = channel.Name
m.Text = ev.Text
+ if m.Text == "" {
+ for _, attach := range ev.Attachments {
+ if attach.Text != "" {
+ m.Text = attach.Text
+ } else {
+ m.Text = attach.Fallback
+ }
+ }
+ }
m.Raw = ev
m.Text = b.replaceMention(m.Text)
if ev.BotID != "" {