Prevent xchat from trying to join channels until I have been authenticated

Solution 1:

If we're talking about freenode (this may apply to others) you can authenticate at the same time as you connect. Just set the server password as your nick's password and you'll auto-login.

You can use nick-grouping and other various cleverness to auto-ghost your old user and take it back.

http://freenode.net/faq.shtml#identify

Or you can auth connecting with any nick by using a slightly more obtuse connect string:

/connect irc.freenode.net 6667 :<username> <password>

In xchat, this means you put :<username> <password> into the server password box.

Solution 2:

There is /set irc_join_delay $SECONDS. Default is 2.

Set it to 20 or any good number (determine it experimentally), and that should do the trick.

Stolen from http://forum.xchat.org/viewtopic.php?f=3&t=3966

Solution 3:

As mentioned on the freenode faq, there are two additional methods you can try. If you have a cloak on freenode, there is a script that will prevent you from joining channels until your cloak has been applied (which requires that you are identified). This method will only work if you have a cloak. The second and better method is to use SASL.

SASL is a method of identifying during your connection, before anything else happens

You can view instructions and access scripts to enable SASL here.

A script for XChat is available here in Python or Perl. To quote the README:

Copy cap_sasl_xchat.py or cap_sasl_xchat.pl to your .xchat/ directory, so that it auto-loads. Once loaded, use the /SASL command to add or remove SASL settings per network -- its help text describes the syntax.