irccloud / irccat

cat to IRC
GNU General Public License v3.0
115 stars 27 forks source link

nickserv identify on freenode loses the race condition #12

Open Habbie opened 5 years ago

Habbie commented 5 years ago

NickServ identify (as implemented through identity_pass in the irccat config) takes several seconds (7-8 on my measurements yesterday) to go through. This means that any JOINs that require the identification will fail.

This patch makes it work:

        if viper.IsSet("irc.identify_pass") && viper.GetString("irc.identify_pass") != "" {
+              log.Infof("Identifying to nickserv, then sleeping for fifteen seconds...")
               i.irc.SendRawf("NICKSERV IDENTIFY %s", viper.GetString("irc.identify_pass"))
+              time.Sleep(15 * time.Second)
        }

but that's terrible. A better approach would be to wait for :NickServ!NickServ@services. NOTICE HammerGit :You are now identified for .HammerGit.. - which was not really made for machine parsing.

For freenode, a better option is #11. However, OFTC does not support SASL so if anybody cares about logging in there, we'd need something that waits for confirmation from NickServ.