summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-11-25 11:08:57 +0100
committerWim <wim@42.be>2018-11-29 00:04:53 +0100
commitba674af5d46ebadbee3c61dfaf89b1f1dfaa05ce (patch)
tree62edece2465c2fcc05720af19aee3798bf9c04cf
parent3c85d937c6931a861ebe8dc2be0d3a431b85be4a (diff)
downloadmatterbridge-msglm-ba674af5d46ebadbee3c61dfaf89b1f1dfaa05ce.tar.gz
matterbridge-msglm-ba674af5d46ebadbee3c61dfaf89b1f1dfaa05ce.tar.bz2
matterbridge-msglm-ba674af5d46ebadbee3c61dfaf89b1f1dfaa05ce.zip
Handle deleted/edited thread starting messages (slack). Fixes #600 (#605)
-rw-r--r--bridge/slack/handlers.go7
-rw-r--r--bridge/slack/slack.go1
2 files changed, 8 insertions, 0 deletions
diff --git a/bridge/slack/handlers.go b/bridge/slack/handlers.go
index a3291c38..035c5af5 100644
--- a/bridge/slack/handlers.go
+++ b/bridge/slack/handlers.go
@@ -202,6 +202,13 @@ func (b *Bslack) handleStatusEvent(ev *slack.MessageEvent, rmsg *config.Message)
rmsg.Event = config.EventJoinLeave
case sChannelTopic, sChannelPurpose:
rmsg.Event = config.EventTopicChange
+ case sMessageChanged:
+ rmsg.Text = ev.SubMessage.Text
+ // handle deleted thread starting messages
+ if ev.SubMessage.Text == "This message was deleted." {
+ rmsg.Event = config.EventMsgDelete
+ return true
+ }
case sMessageDeleted:
rmsg.Text = config.EventMsgDelete
rmsg.Event = config.EventMsgDelete
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index 0951fb10..4251f83b 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -48,6 +48,7 @@ const (
sChannelLeave = "channel_leave"
sChannelJoined = "channel_joined"
sMemberJoined = "member_joined_channel"
+ sMessageChanged = "message_changed"
sMessageDeleted = "message_deleted"
sSlackAttachment = "slack_attachment"
sPinnedItem = "pinned_item"