Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

IRC client attempts to join channels prematurely in Slack #35

Open
stanhu opened this issue Jun 12, 2015 · 0 comments
Open

IRC client attempts to join channels prematurely in Slack #35

stanhu opened this issue Jun 12, 2015 · 0 comments

Comments

@stanhu
Copy link

stanhu commented Jun 12, 2015

When BotBot connects to a Slack IRC server, it seems to be too quick to call bot.JoinAll(), which results in the bot not joining most of the channels. I modified irc/irc.go to join after the message of the day (MOTD) is displayed, and this seems to work:

        // After USER / NICK is accepted, join all the channels,
        // assuming we don't need to identify with NickServ
        bot.RLock()
@@ -628,10 +640,16 @@ func (bot *ircBot) act(theLine *line.Line) {
                bot.Lock()
                bot.isAuthenticating = false
                bot.Unlock()
-               bot.JoinAll()
+               //bot.JoinAll()
                return
        }

+    if theLine.Command == "376" {
+       glog.Infoln("MOTD done, joining now!")
+       bot.JoinAll()
+    }
+

A few questions:

  1. Could you implement a more robust way of sending a JOIN message at the right time? For example, the client may attempt to send a LIST command and get a response before attempting to join all channels.
  2. Should the IRC client periodically check which channels it is in, and then rejoin any of the channels not in its targeted list?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant