From 778abea2d9e2d0ec0b05f9197ba0ef2a7d7da725 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 16 Jul 2017 18:08:26 +0200 Subject: Add support for fallback/text in attachments (slack) --- bridge/slack/slack.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bridge') 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 != "" { -- cgit v1.2.3