summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/mattermost')
-rw-r--r--bridge/mattermost/mattermost.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 2e934469..5e04923e 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -10,6 +10,7 @@ import (
"github.com/42wim/matterbridge/bridge/helper"
"github.com/42wim/matterbridge/matterclient"
"github.com/42wim/matterbridge/matterhook"
+ "github.com/mattermost/platform/model"
"github.com/rs/xid"
)
@@ -239,11 +240,11 @@ func (b *Bmattermost) handleMatterClient(messages chan *config.Message) {
}
// create a text for bridges that don't support native editing
- if message.Raw.Event == "post_edited" && !b.GetBool("EditDisable") {
+ if message.Raw.Event == model.WEBSOCKET_EVENT_POST_EDITED && !b.GetBool("EditDisable") {
rmsg.Text = message.Text + b.GetString("EditSuffix")
}
- if message.Raw.Event == "post_deleted" {
+ if message.Raw.Event == model.WEBSOCKET_EVENT_POST_DELETED {
rmsg.Event = config.EVENT_MSG_DELETE
}
@@ -434,7 +435,7 @@ func (b *Bmattermost) skipMessage(message *matterclient.Message) bool {
}
// Handle edited messages
- if (message.Raw.Event == "post_edited") && b.GetBool("EditDisable") {
+ if (message.Raw.Event == model.WEBSOCKET_EVENT_POST_EDITED) && b.GetBool("EditDisable") {
return true
}
@@ -462,7 +463,7 @@ func (b *Bmattermost) skipMessage(message *matterclient.Message) bool {
}
// only handle posted, edited or deleted events
- if !(message.Raw.Event == "posted" || message.Raw.Event == "post_edited" || message.Raw.Event == "post_deleted") {
+ if !(message.Raw.Event == "posted" || message.Raw.Event == model.WEBSOCKET_EVENT_POST_EDITED || message.Raw.Event == model.WEBSOCKET_EVENT_POST_DELETED) {
return true
}
return false