summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-11-08 22:20:03 +0100
committerWim <wim@42.be>2018-11-08 22:20:03 +0100
commitb2a07aba3a4343087bdbaa2bb5ef7d703bca79e1 (patch)
tree33c5faa17e737159e8235d0c6b1b57f28e2188d5 /bridge/mattermost
parent1e0bb3da954831d41ae958da22bf7294dbbe0822 (diff)
downloadmatterbridge-msglm-b2a07aba3a4343087bdbaa2bb5ef7d703bca79e1.tar.gz
matterbridge-msglm-b2a07aba3a4343087bdbaa2bb5ef7d703bca79e1.tar.bz2
matterbridge-msglm-b2a07aba3a4343087bdbaa2bb5ef7d703bca79e1.zip
Make goconst linter happy
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