Send user_added and removed event through message channel (mattermost)

This commit is contained in:
Wim 2019-04-02 00:15:58 +02:00
parent 1f8016182c
commit 17cc14a9d2
2 changed files with 8 additions and 5 deletions

View File

@ -51,10 +51,8 @@ func (m *MMClient) GetChannelId(name string, teamId string) string { //nolint:go
if res == name { if res == name {
return channel.Id return channel.Id
} }
} else { } else if channel.Name == name {
if channel.Name == name { return channel.Id
return channel.Id
}
} }
} }
} }

View File

@ -216,9 +216,14 @@ func (m *MMClient) WsReceiver() {
if msg.Post != nil { if msg.Post != nil {
if msg.Text != "" || len(msg.Post.FileIds) > 0 || msg.Post.Type == "slack_attachment" { if msg.Text != "" || len(msg.Post.FileIds) > 0 || msg.Post.Type == "slack_attachment" {
m.MessageChan <- msg 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 var response model.WebSocketResponse