diff options
author | Wim <wim@42.be> | 2018-11-11 22:42:33 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-11 22:44:10 +0100 |
commit | d2ae3ebf9e40360c644039f4c0ef10d5712d6c69 (patch) | |
tree | 265b4e6658e2b5c3e27d1adc21eb7ed6cff386f0 /bridge/mattermost/mattermost.go | |
parent | 730ccdd4567de7bbcf8794fef95a7324cef5198b (diff) | |
download | matterbridge-msglm-d2ae3ebf9e40360c644039f4c0ef10d5712d6c69.tar.gz matterbridge-msglm-d2ae3ebf9e40360c644039f4c0ef10d5712d6c69.tar.bz2 matterbridge-msglm-d2ae3ebf9e40360c644039f4c0ef10d5712d6c69.zip |
Disable Connect(), JoinChannel(), Send() for mattermost.plugin
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r-- | bridge/mattermost/mattermost.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 55a4e853..46eac03f 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -34,6 +34,9 @@ func (b *Bmattermost) Command(cmd string) string { } func (b *Bmattermost) Connect() error { + if b.Account == "mattermost.plugin" { + return nil + } if b.GetString("WebhookBindAddress") != "" { switch { case b.GetString("WebhookURL") != "": @@ -110,6 +113,9 @@ func (b *Bmattermost) Disconnect() error { } func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error { + if b.Account == "mattermost.plugin" { + return nil + } // we can only join channels using the API if b.GetString("WebhookURL") == "" && b.GetString("WebhookBindAddress") == "" { id := b.mc.GetChannelId(channel.Name, b.TeamID) @@ -122,6 +128,9 @@ func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error { } func (b *Bmattermost) Send(msg config.Message) (string, error) { + if b.Account == "mattermost.plugin" { + return "", nil + } b.Log.Debugf("=> Receiving %#v", msg) // Make a action /me of the message |