From b2a07aba3a4343087bdbaa2bb5ef7d703bca79e1 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 8 Nov 2018 22:20:03 +0100 Subject: Make goconst linter happy --- bridge/mattermost/mattermost.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bridge/mattermost') 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 -- cgit v1.2.3