From cc5ce3d5ae8d2edc98723de5f42259cff0594050 Mon Sep 17 00:00:00 2001 From: Jerry Heiselman Date: Mon, 17 Jul 2017 11:33:28 -0500 Subject: Suppress parent message when child message is received (slack) (#218) * Suppress parent message when child message is received When a thread is started in Slack and a user makes a comment on the thread, matterbridge sends the original parent message again on each child comment. This change suppresses that. * Update slack.go Moved determination of ThreadTimestamp to handleSlackClient so the MMMessage struct doesn't need to be modified * Ran 'go fmt' --- bridge/slack/slack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 4f9b7fc7..b6753bb5 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -241,7 +241,7 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) { // ignore first message if count > 0 { flog.Debugf("Receiving from slackclient %#v", ev) - if !b.Config.EditDisable && ev.SubMessage != nil { + if !b.Config.EditDisable && ev.SubMessage != nil && ev.SubMessage.ThreadTimestamp != ev.SubMessage.Timestamp { flog.Debugf("SubMessage %#v", ev.SubMessage) ev.User = ev.SubMessage.User ev.Text = ev.SubMessage.Text + b.Config.EditSuffix -- cgit v1.2.3