5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-14 03:50:26 +00:00

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'
This commit is contained in:
Jerry Heiselman 2017-07-17 11:33:28 -05:00 committed by Wim
parent caaf6f3012
commit cc5ce3d5ae

View File

@ -241,7 +241,7 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
// ignore first message // ignore first message
if count > 0 { if count > 0 {
flog.Debugf("Receiving from slackclient %#v", ev) 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) flog.Debugf("SubMessage %#v", ev.SubMessage)
ev.User = ev.SubMessage.User ev.User = ev.SubMessage.User
ev.Text = ev.SubMessage.Text + b.Config.EditSuffix ev.Text = ev.SubMessage.Text + b.Config.EditSuffix