5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-14 03:50:26 +00:00

Handle deleted/edited thread starting messages (slack). Fixes #600 (#605)

This commit is contained in:
Wim 2018-11-25 11:08:57 +01:00 committed by Duco van Amstel
parent f3a5ea2956
commit 8869e253ca
2 changed files with 8 additions and 0 deletions

View File

@ -202,6 +202,13 @@ func (b *Bslack) handleStatusEvent(ev *slack.MessageEvent, rmsg *config.Message)
rmsg.Event = config.EventJoinLeave rmsg.Event = config.EventJoinLeave
case sChannelTopic, sChannelPurpose: case sChannelTopic, sChannelPurpose:
rmsg.Event = config.EventTopicChange 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: case sMessageDeleted:
rmsg.Text = config.EventMsgDelete rmsg.Text = config.EventMsgDelete
rmsg.Event = config.EventMsgDelete rmsg.Event = config.EventMsgDelete

View File

@ -48,6 +48,7 @@ const (
sChannelLeave = "channel_leave" sChannelLeave = "channel_leave"
sChannelJoined = "channel_joined" sChannelJoined = "channel_joined"
sMemberJoined = "member_joined_channel" sMemberJoined = "member_joined_channel"
sMessageChanged = "message_changed"
sMessageDeleted = "message_deleted" sMessageDeleted = "message_deleted"
sSlackAttachment = "slack_attachment" sSlackAttachment = "slack_attachment"
sPinnedItem = "pinned_item" sPinnedItem = "pinned_item"