summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-04-07 22:27:36 +0200
committerWim <wim@42.be>2017-04-07 22:27:36 +0200
commitbd38319d8352e48eb0e29c5e30f094e5430d63e8 (patch)
treea35b3d1bad7019476169ca4e39a44162e5393e00 /bridge/mattermost
parent33dffd5ea84890c85771a8ab759750192501f041 (diff)
downloadmatterbridge-msglm-bd38319d8352e48eb0e29c5e30f094e5430d63e8.tar.gz
matterbridge-msglm-bd38319d8352e48eb0e29c5e30f094e5430d63e8.tar.bz2
matterbridge-msglm-bd38319d8352e48eb0e29c5e30f094e5430d63e8.zip
Add support for showing/hiding join/leave messages from mattermost. Closes #147
Diffstat (limited to 'bridge/mattermost')
-rw-r--r--bridge/mattermost/mattermost.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index dec8fcb4..439ce9c9 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -131,6 +131,14 @@ func (b *Bmattermost) handleMatter() {
func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) {
for message := range b.mc.MessageChan {
+ flog.Debugf("%#v", message.Raw.Data)
+ if message.Type == "system_join_leave" ||
+ message.Type == "system_join_channel" ||
+ message.Type == "system_leave_channel" {
+ flog.Debugf("Sending JOIN_LEAVE event from %s to gateway", b.Account)
+ b.Remote <- config.Message{Username: "system", Text: message.Text, Channel: message.Channel, Account: b.Account, Event: config.EVENT_JOIN_LEAVE}
+ continue
+ }
// do not post our own messages back to irc
// only listen to message from our team
if message.Raw.Event == "posted" && b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId {