5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 20:40:27 +00:00

Add channel_purpose to ShowTopicChange. Ignore (un)pinned_item (slack). #353

This commit is contained in:
Wim 2018-02-03 01:15:57 +01:00
parent 80822b7fff
commit 0bcd1e62f3

View File

@ -304,7 +304,7 @@ func (b *Bslack) handleSlack() {
msg.Event = config.EVENT_MSG_DELETE msg.Event = config.EVENT_MSG_DELETE
msg.ID = "slack " + message.Raw.DeletedTimestamp 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 msg.Event = config.EVENT_TOPIC_CHANGE
} }
@ -342,6 +342,9 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
} }
switch ev := msg.Data.(type) { switch ev := msg.Data.(type) {
case *slack.MessageEvent: case *slack.MessageEvent:
if ev.SubType == "pinned_item" || ev.SubType == "unpinned_item" {
continue
}
if len(ev.Attachments) > 0 { if len(ev.Attachments) > 0 {
// skip messages we made ourselves // skip messages we made ourselves
if ev.Attachments[0].CallbackID == "matterbridge" { if ev.Attachments[0].CallbackID == "matterbridge" {