commit 5b80ef0149e2064133200330bbf3778d451e6f63
Author: Wim <wim@42.be>
Date: Sun Oct 23 21:16:14 2016 +0000
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index ce50663..2a9749d 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -316 +317 @@ type Bmattermost struct {
name string
origin string
protocol string
+ TeamId string
}
var flog *log.Entry
@@ -756 +767 @@ func (b *Bmattermost) Connect() error {
go b.mc.WsReceiver()
}
go b.handleMatter()
+ b.TeamId = b.mc.GetTeamId()
return nil
}
@@ -1537 +1558 @@ func (b *Bmattermost) handleMatter() {
func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) {
for message := range b.mc.MessageChan {
// do not post our own messages back to irc
- if message.Raw.Event == "posted" && b.mc.User.Username != message.Username {
+ // only listen to message from our team
+ if message.Raw.Event == "posted" && b.mc.User.Username != message.Username && message.Raw.TeamId == b.TeamId {
flog.Debugf("Receiving from matterclient %#v", message)
m := &MMMessage{}
m.Username = message.Username
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go
index 1bac634..3753048 100644
--- a/matterclient/matterclient.go
+++ b/matterclient/matterclient.go
@@ -5766 +57610 @@ func (m *MMClient) GetStatus(userId string) string {
return "offline"
}
+func (m *MMClient) GetTeamId() string {
+ return m.Team.Id
+}
+
func (m *MMClient) StatusLoop() {
for {
if m.WsQuit {