From 0bcd1e62f3125676d10bac2bcfc08a3ef00eb10b Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 3 Feb 2018 01:15:57 +0100 Subject: Add channel_purpose to ShowTopicChange. Ignore (un)pinned_item (slack). #353 --- bridge/slack/slack.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 8e5e2606..1aca7629 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -304,7 +304,7 @@ func (b *Bslack) handleSlack() { msg.Event = config.EVENT_MSG_DELETE msg.ID = "slack " + message.Raw.DeletedTimestamp } - if message.Raw.SubType == "channel_topic" { + if message.Raw.SubType == "channel_topic" || message.Raw.SubType == "channel_purpose" { msg.Event = config.EVENT_TOPIC_CHANGE } @@ -342,6 +342,9 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) { } switch ev := msg.Data.(type) { case *slack.MessageEvent: + if ev.SubType == "pinned_item" || ev.SubType == "unpinned_item" { + continue + } if len(ev.Attachments) > 0 { // skip messages we made ourselves if ev.Attachments[0].CallbackID == "matterbridge" { -- cgit v1.2.3