5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-26 06:31:36 +00:00

Send first message after connect (slack). Closes #252

This commit is contained in:
Wim 2017-09-07 23:47:23 +02:00
parent 01badde21d
commit a3470f8aec

View File

@ -257,12 +257,9 @@ func (b *Bslack) handleSlack() {
} }
func (b *Bslack) handleSlackClient(mchan chan *MMMessage) { func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
count := 0
for msg := range b.rtm.IncomingEvents { for msg := range b.rtm.IncomingEvents {
switch ev := msg.Data.(type) { switch ev := msg.Data.(type) {
case *slack.MessageEvent: case *slack.MessageEvent:
// ignore first message
if count > 0 {
flog.Debugf("Receiving from slackclient %#v", ev) flog.Debugf("Receiving from slackclient %#v", ev)
if len(ev.Attachments) > 0 { if len(ev.Attachments) > 0 {
// skip messages we made ourselves // skip messages we made ourselves
@ -314,8 +311,6 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
} }
} }
mchan <- m mchan <- m
}
count++
case *slack.OutgoingErrorEvent: case *slack.OutgoingErrorEvent:
flog.Debugf("%#v", ev.Error()) flog.Debugf("%#v", ev.Error())
case *slack.ChannelJoinedEvent: case *slack.ChannelJoinedEvent: