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:
parent
2fde7559e3
commit
d9d1c4aba8
@ -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,10 +157,13 @@ public class IRCConnection extends PircBot
|
||||
ServerInfo.DEFAULT_NAME
|
||||
);
|
||||
|
||||
if (server.getAuthentication().hasNickservCredentials()) {
|
||||
identify(server.getAuthentication().getNickservPassword());
|
||||
}
|
||||
|
||||
service.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* On register
|
||||
*/
|
||||
@ -244,8 +247,8 @@ public class IRCConnection extends PircBot
|
||||
}
|
||||
|
||||
if (sender.equals(this.getNick())) {
|
||||
// Don't notify for something sent in our name
|
||||
return;
|
||||
// Don't notify for something sent in our name
|
||||
return;
|
||||
}
|
||||
|
||||
boolean mentioned = isMentioned(action);
|
||||
@ -1143,8 +1146,9 @@ public class IRCConnection extends PircBot
|
||||
|
||||
synchronized(isQuittingLock) {
|
||||
isQuitting = false;
|
||||
if (disposeRequested)
|
||||
if (disposeRequested) {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1266,10 +1270,11 @@ public class IRCConnection extends PircBot
|
||||
public void dispose()
|
||||
{
|
||||
synchronized(isQuittingLock) {
|
||||
if (isQuitting)
|
||||
if (isQuitting) {
|
||||
disposeRequested = true;
|
||||
else
|
||||
} else {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user