Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 47f8ffc0cdd13f4f6b85490b46f5e33e54a5925a Author: Wim <wim@42.be> Date: Tue Apr 02 00:15:58 2019 +0000 Send user_added and removed event through message channel (mattermost) diff --git a/matterclient/channels.go b/matterclient/channels.go index 568a20e..0eac29f 100644 --- a/matterclient/channels.go +++ b/matterclient/channels.go @@ -5110 +518 @@ func (m *MMClient) GetChannelId(name string, teamId string) string { //nolint:go   if res == name {   return channel.Id   } - } else { - if channel.Name == name { - return channel.Id - } + } else if channel.Name == name { + return channel.Id   }   }   } diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 18006c7..f21cc06 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -2169 +21614 @@ func (m *MMClient) WsReceiver() {   if msg.Post != nil {   if msg.Text != "" || len(msg.Post.FileIds) > 0 || msg.Post.Type == "slack_attachment" {   m.MessageChan <- msg + continue   }   } - continue + switch msg.Raw.Event { + case model.WEBSOCKET_EVENT_USER_ADDED, model.WEBSOCKET_EVENT_USER_REMOVED: + m.MessageChan <- msg + continue + }   }     var response model.WebSocketResponse