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