Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit f7b7e3a60c5aeeaa4d5baea08419652f1c95fb25 Author: Wim <wim@42.be> Date: Tue Nov 13 20:40:15 2018 +0000 Fix goconst linter failure diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 46eac03..26a6cb4 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -236 +238 @@ type Bmattermost struct {   avatarMap map[string]string  }   +const mattermostPlugin = "mattermost.plugin" +  func New(cfg *bridge.Config) bridge.Bridger {   b := &Bmattermost{Config: cfg, avatarMap: make(map[string]string)}   b.uuid = xid.New().String() @@ -347 +367 @@ func (b *Bmattermost) Command(cmd string) string {  }    func (b *Bmattermost) Connect() error { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin {   return nil   }   if b.GetString("WebhookBindAddress") != "" { @@ -1137 +1157 @@ func (b *Bmattermost) Disconnect() error {  }    func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin {   return nil   }   // we can only join channels using the API @@ -1287 +1307 @@ func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error {  }    func (b *Bmattermost) Send(msg config.Message) (string, error) { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin {   return "", nil   }   b.Log.Debugf("=> Receiving %#v", msg)