4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 14:19:24 +00:00

Add support for showing/hiding join/leave messages from mattermost. Closes #147

This commit is contained in:
Wim
2017-04-07 22:27:36 +02:00
parent 33dffd5ea8
commit bd38319d83
3 changed files with 30 additions and 10 deletions

View File

@ -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 {