public class NickServAuthPlugin extends TaskImpl
If 40 seconds passes and the mode event to indicate ident success has not been received, TaskCompletion Listeners will be notified with a false Boolean object.
This plugin assumes Nickserv responds to the following syntax
"identify password"
To cancel this Task call cancel()
Example Code:
final NickServAuthPlugin auth = new NickServAuthPlugin ( "letmein", //password 'e', //mode char that indicates success session, //session Arrays.asList("#jerklib" , "##swing") // list of channels to join on success ); // task listener is optional auth.addTaskListener(new TaskCompletionListener() { public void taskComplete(Object result) { if(result.equals(new Boolean(false))) { conman.quit(); } else { System.out.println("Authed!"); } } });
Session.onEvent(jerklib.tasks.Task, jerklib.events.IRCEvent.Type...)
,
IRCEvent.Type
Constructor and Description |
---|
NickServAuthPlugin(java.lang.String pass,
char identMode,
Session session,
java.util.List<java.lang.String> channels) |
Modifier and Type | Method and Description |
---|---|
void |
receiveEvent(IRCEvent e)
recieveEvent() - receive IRCEvents
|
addTaskListener, cancel, getName, getTaskListeners, isCanceled, removeTaskListener
public NickServAuthPlugin(java.lang.String pass, char identMode, Session session, java.util.List<java.lang.String> channels)
pass
- - nickserv passwordidentMode
- - mode that indicates ident successsession
- - Session this Task is attatched tochannels
- - A list of channel names to join on ident successpublic void receiveEvent(IRCEvent e)
IRCEventListener
e
- IRCEvent the event