mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-25 04:02:03 -08:00
Handle slack attachments sent to mattermost. Closes #447
This commit is contained in:
parent
594492fbdd
commit
d2c02be3a0
@ -221,6 +221,18 @@ func (b *Bmattermost) handleMatterClient(messages chan *config.Message) {
|
||||
}
|
||||
if _, ok := props["attachments"].([]interface{}); ok {
|
||||
rmsg.Extra["attachments"] = props["attachments"].([]interface{})
|
||||
if rmsg.Text == "" {
|
||||
for _, attachment := range rmsg.Extra["attachments"] {
|
||||
attach := attachment.(map[string]interface{})
|
||||
if attach["text"].(string) != "" {
|
||||
rmsg.Text += attach["text"].(string)
|
||||
continue
|
||||
}
|
||||
if attach["fallback"].(string) != "" {
|
||||
rmsg.Text += attach["fallback"].(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user