Skip to content

Commit

Permalink
Revert #115 (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Barberio <[email protected]>
  • Loading branch information
insomniacslk authored May 5, 2020
1 parent e3b67c6 commit e38b1e9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,18 +320,9 @@ func eventHandler(ctx *IrcContext, rtm *slack.RTM) {
ctx.SlackConnected = true
case *slack.DisconnectedEvent:
de := msg.Data.(*slack.DisconnectedEvent)
log.Warningf("Disconnected from Slack (intentional: %v, cause: %s)", de.Intentional, de.Cause)
log.Warningf("Disconnected from Slack (intentional: %v, cause: %v)", de.Intentional, de.Cause)
ctx.SlackConnected = false
// only close the IRC client connection if the disconnection from
// Slack was intentional. Otherwise RTM.ManageConnection will retry
// automatically to connect. If reconnection fails, it will surface
// in a subsequent event, so it's safe here not to wait for a
// reconnection.
if de.Intentional {
if err := ctx.Conn.Close(); err != nil {
log.Warningf("Failed to close connection to IRC client: %v", err)
}
}
ctx.Conn.Close()
return
case *slack.MemberJoinedChannelEvent, *slack.MemberLeftChannelEvent:
// refresh the users list
Expand Down

0 comments on commit e38b1e9

Please sign in to comment.