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:
parent
01badde21d
commit
a3470f8aec
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user