5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-24 18:25:40 +00:00

Suppress unhandled HelloEvent message (slack) (#913)

This commit is contained in:
Qais Patankar 2019-10-03 23:19:50 +01:00 committed by Wim
parent ba6759010b
commit 1d708ab351
2 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ func (b *Bslack) handleSlack() {
func (b *Bslack) handleSlackClient(messages chan *config.Message) {
for msg := range b.rtm.IncomingEvents {
if msg.Type != sUserTyping && msg.Type != sLatencyReport {
if msg.Type != sUserTyping && msg.Type != sHello && msg.Type != sLatencyReport {
b.Log.Debugf("== Receiving event %#v", msg.Data)
}
switch ev := msg.Data.(type) {
@ -86,7 +86,7 @@ func (b *Bslack) handleSlackClient(messages chan *config.Message) {
b.Log.Errorf("Connection failed %#v %#v", ev.Error(), ev.ErrorObj)
case *slack.MemberJoinedChannelEvent:
b.users.populateUser(ev.User)
case *slack.LatencyReport:
case *slack.HelloEvent, *slack.LatencyReport:
continue
default:
b.Log.Debugf("Unhandled incoming event: %T", ev)

View File

@ -12,7 +12,7 @@ import (
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/bridge/helper"
"github.com/42wim/matterbridge/matterhook"
"github.com/hashicorp/golang-lru"
lru "github.com/hashicorp/golang-lru"
"github.com/nlopes/slack"
"github.com/rs/xid"
)
@ -36,6 +36,7 @@ type Bslack struct {
}
const (
sHello = "hello"
sChannelJoin = "channel_join"
sChannelLeave = "channel_leave"
sChannelJoined = "channel_joined"