From 54e0e14f41ec900ca6617e1b046d5bd4d00fab7c Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 11 Mar 2019 18:11:36 -0400 Subject: [PATCH] slackapp: filter out ungood message types --- connectors/slackapp/slackApp.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/connectors/slackapp/slackApp.go b/connectors/slackapp/slackApp.go index fca94d0..52e3e31 100644 --- a/connectors/slackapp/slackApp.go +++ b/connectors/slackapp/slackApp.go @@ -140,6 +140,17 @@ func (s *SlackApp) checkRingOrAdd(ts string) bool { } func (s *SlackApp) msgReceivd(msg *slackevents.MessageEvent) { + if msg.TimeStamp == "" { + log.Debug(). + Str("type", msg.SubType). + Msg("ignoring an unhandled event type") + return + } + + log.Debug(). + Str("type", msg.SubType). + Msg("accepting a message") + if s.checkRingOrAdd(msg.TimeStamp) { log.Debug(). Str("ts", msg.TimeStamp).