diff --git a/application/src/org/yaaic/irc/IRCConnection.java b/application/src/org/yaaic/irc/IRCConnection.java index f310f44..63fbe98 100644 --- a/application/src/org/yaaic/irc/IRCConnection.java +++ b/application/src/org/yaaic/irc/IRCConnection.java @@ -155,7 +155,14 @@ public class IRCConnection extends PircBot ); service.sendBroadcast(intent); + } + + /** + * On register + */ + public void onRegister() + { // execute commands CommandParser parser = CommandParser.getInstance(); @@ -164,6 +171,10 @@ public class IRCConnection extends PircBot parser.parse(command, server, server.getConversation(ServerInfo.DEFAULT_NAME), service); } + // TODO: Detect "You are now identified for " notices from NickServ and handle + // auto joins in onNotice instead if the user has chosen to wait for NickServ + // identification before auto joining channels. + // delay 1 sec before auto joining channels try { Thread.sleep(1000); @@ -183,7 +194,6 @@ public class IRCConnection extends PircBot } } } - /** * On channel action */ @@ -988,6 +998,11 @@ public class IRCConnection extends PircBot @Override protected void onServerResponse(int code, String response) { + if (code == 4) { + // User has registered with the server + onRegister(); + return; + } if (code == 372 || code == 375 || code == 376) { // Skip MOTD return;