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 коммит произвёл Wim
Родитель caaf6f3012
Коммит cc5ce3d5ae
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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