diff options
author | Wim <wim@42.be> | 2017-07-16 18:08:26 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-16 18:08:26 +0200 |
commit | 778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725 (patch) | |
tree | 7e2a1017ba7aba0e90835c81a831fccdb2c13418 /bridge/slack | |
parent | 835a1ac3a623b5b163fbb8f8700ba1994d83a97c (diff) | |
download | matterbridge-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.go | 9 |
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 != "" { |