diff options
author | Jerry Heiselman <jheiselman@users.noreply.github.com> | 2017-07-17 11:33:28 -0500 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-17 18:33:28 +0200 |
commit | cc5ce3d5ae8d2edc98723de5f42259cff0594050 (patch) | |
tree | 62f41c23295190c9dae922e677eab34b1324e6d2 /bridge/slack | |
parent | caaf6f3012837b3623d2d3b8413d1b156eef68cf (diff) | |
download | matterbridge-msglm-cc5ce3d5ae8d2edc98723de5f42259cff0594050.tar.gz matterbridge-msglm-cc5ce3d5ae8d2edc98723de5f42259cff0594050.tar.bz2 matterbridge-msglm-cc5ce3d5ae8d2edc98723de5f42259cff0594050.zip |
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'
Diffstat (limited to 'bridge/slack')
-rw-r--r-- | bridge/slack/slack.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 |