summaryrefslogtreecommitdiffstats
path: root/bridge/slack
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-03-27 22:54:18 +0100
committerGitHub <noreply@github.com>2019-03-27 22:54:18 +0100
commit64b57f2da339d38b0cd79c3e20f480b90531d180 (patch)
tree0e9758549ef33cf0db4988dafe1a68326961a609 /bridge/slack
parentefd2c9986270a8a1dd35f896a80d6465fc52054b (diff)
downloadmatterbridge-msglm-64b57f2da339d38b0cd79c3e20f480b90531d180.tar.gz
matterbridge-msglm-64b57f2da339d38b0cd79c3e20f480b90531d180.tar.bz2
matterbridge-msglm-64b57f2da339d38b0cd79c3e20f480b90531d180.zip
Ignore message_replied and hidden messages (slack). Fixes #709 (#779)
Diffstat (limited to 'bridge/slack')
-rw-r--r--bridge/slack/handlers.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/bridge/slack/handlers.go b/bridge/slack/handlers.go
index b7563931..87102636 100644
--- a/bridge/slack/handlers.go
+++ b/bridge/slack/handlers.go
@@ -130,12 +130,18 @@ func (b *Bslack) skipMessageEvent(ev *slack.MessageEvent) bool {
return true
}
- // It seems ev.SubMessage.Edited == nil when slack unfurls.
- // Do not forward these messages. See Github issue #266.
- if ev.SubMessage != nil &&
- ev.SubMessage.ThreadTimestamp != ev.SubMessage.Timestamp &&
- ev.SubMessage.Edited == nil {
- return true
+ if ev.SubMessage != nil {
+ // It seems ev.SubMessage.Edited == nil when slack unfurls.
+ // Do not forward these messages. See Github issue #266.
+ if ev.SubMessage.ThreadTimestamp != ev.SubMessage.Timestamp &&
+ ev.SubMessage.Edited == nil {
+ return true
+ }
+ // see hidden subtypes at https://api.slack.com/events/message
+ // these messages are sent when we add a message to a thread #709
+ if ev.SubType == "message_replied" && ev.Hidden {
+ return true
+ }
}
if len(ev.Files) > 0 {