zD12 / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

No event for NickAlreadyInUse in 2.0 #140

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce:
 - Connect to a server with a nick already used

Expected behaviour:
 - I get notified (either by an IrcException or event) that the nick is currently in use.

Actual behaviour:
 - The IrcException thrown in InputParser.java:236 gets swallowed by try/catch at PircBotX.java:271 (revision 1b78a9cc5a58), and doesn't dispatch an event before throwing the exception.

Original issue reported on code.google.com by erik.joh...@openmarket.com on 21 Aug 2013 at 2:10

GoogleCodeExporter commented 9 years ago
This was due to moving all the connect code to InputParser. It makes sense to 
keep all IRC code there but complicates exceptions. 

Revision 049c8c349ff9 has a new event NickAlreadyInUseEvent that is dispatched 
any time that a nick is already in use. If autoNickChange is on, then 
autoNewNick contains a new nick PircBotX is going to attempt to use. If its 
off, then the bot will do nothing until you either send a new nick or the 
server times out the connection. 

Thank you for noticing this bug, I completely missed it

Original comment by Lord.Qua...@gmail.com on 2 Sep 2013 at 1:44