summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-10-27 22:02:25 +0200
committerWim <wim@42.be>2018-10-27 22:02:25 +0200
commite2b50d6194ab825de8c6443d46b642ecd3a0313c (patch)
treeb8307a3e96f8ebcf380ae470776aada24156f131 /bridge/mattermost
parent74e33b0a51f6d8b5cebd355ac3dd0e825e2c83a7 (diff)
downloadmatterbridge-msglm-e2b50d6194ab825de8c6443d46b642ecd3a0313c.tar.gz
matterbridge-msglm-e2b50d6194ab825de8c6443d46b642ecd3a0313c.tar.bz2
matterbridge-msglm-e2b50d6194ab825de8c6443d46b642ecd3a0313c.zip
Add better support for multiperson DM (mattermost)
Diffstat (limited to 'bridge/mattermost')
-rw-r--r--bridge/mattermost/mattermost.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 2fed284e..c9a7c664 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -109,7 +109,7 @@ func (b *Bmattermost) Disconnect() error {
func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error {
// we can only join channels using the API
if b.GetString("WebhookURL") == "" && b.GetString("WebhookBindAddress") == "" {
- id := b.mc.GetChannelId(channel.Name, "")
+ id := b.mc.GetChannelId(channel.Name, b.TeamID)
if id == "" {
return fmt.Errorf("Could not find channel ID for channel %s", channel.Name)
}
@@ -147,7 +147,7 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
// Upload a file if it exists
if msg.Extra != nil {
for _, rmsg := range helper.HandleExtra(&msg, b.General) {
- b.mc.PostMessage(b.mc.GetChannelId(rmsg.Channel, ""), rmsg.Username+rmsg.Text)
+ b.mc.PostMessage(b.mc.GetChannelId(rmsg.Channel, b.TeamID), rmsg.Username+rmsg.Text)
}
if len(msg.Extra["file"]) > 0 {
return b.handleUploadFile(&msg)
@@ -165,7 +165,7 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
}
// Post normal message
- return b.mc.PostMessage(b.mc.GetChannelId(msg.Channel, ""), msg.Text)
+ return b.mc.PostMessage(b.mc.GetChannelId(msg.Channel, b.TeamID), msg.Text)
}
func (b *Bmattermost) handleMatter() {
@@ -357,7 +357,7 @@ func (b *Bmattermost) handleDownloadFile(rmsg *config.Message, id string) error
func (b *Bmattermost) handleUploadFile(msg *config.Message) (string, error) {
var err error
var res, id string
- channelID := b.mc.GetChannelId(msg.Channel, "")
+ channelID := b.mc.GetChannelId(msg.Channel, b.TeamID)
for _, f := range msg.Extra["file"] {
fi := f.(config.FileInfo)
id, err = b.mc.UploadFile(*fi.Data, channelID, fi.Name)