mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-22 08:52:18 -05:00
Handle auto joins after the user has registered with the server.
This commit is contained in:
parent
84d45c5f5c
commit
a3ebf8d5d0
@ -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 <nick>" 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;
|
||||
|
Loading…
Reference in New Issue
Block a user