1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-08 12:18:07 -05:00

(Authentication) Implementation of authentication via NickServ on connect

This commit is contained in:
Sebastian Kaspari 2011-06-10 21:36:14 +02:00
parent 2fde7559e3
commit d9d1c4aba8

View File

@ -55,7 +55,7 @@ public class IRCConnection extends PircBot
private boolean isQuitting = false;
private boolean disposeRequested = false;
private Object isQuittingLock = new Object();
private final Object isQuittingLock = new Object();
/**
* Create a new connection
@ -157,9 +157,12 @@ public class IRCConnection extends PircBot
ServerInfo.DEFAULT_NAME
);
service.sendBroadcast(intent);
if (server.getAuthentication().hasNickservCredentials()) {
identify(server.getAuthentication().getNickservPassword());
}
service.sendBroadcast(intent);
}
/**
* On register
@ -1143,10 +1146,11 @@ public class IRCConnection extends PircBot
synchronized(isQuittingLock) {
isQuitting = false;
if (disposeRequested)
if (disposeRequested) {
super.dispose();
}
}
}
/**
* Get all channels where the user with the given nickname is online
@ -1266,10 +1270,11 @@ public class IRCConnection extends PircBot
public void dispose()
{
synchronized(isQuittingLock) {
if (isQuitting)
if (isQuitting) {
disposeRequested = true;
else
} else {
super.dispose();
}
}
}
}