diff options
Diffstat (limited to 'EssentialsUpdate/src/f00f/net/irc/martyr/replies')
23 files changed, 0 insertions, 1153 deletions
diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AbstractWhoisReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AbstractWhoisReply.java deleted file mode 100644 index d52e59dcf..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AbstractWhoisReply.java +++ /dev/null @@ -1,58 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.util.ParameterIterator; - -public abstract class AbstractWhoisReply extends GenericReply -{ - //static Logger log = Logger.getLogger(AbstractWhoisReply.class); - - private String target = null; - - /** - * Factory constructor. - * */ - public AbstractWhoisReply() - { - } - - public AbstractWhoisReply( String params ) - { - ParameterIterator pi = getParams( params ); - parseParams( pi ); - } - - public abstract String getIrcIdentifier(); - - /** - * Parse the parameters, but the target param has already been - * stripped off. - * - * @param pi Parameter iterator that will parse the parameters - * */ - protected abstract void parseParams( ParameterIterator pi ); - - /** - * @return the target of the whois - * */ - public String getTarget() - { - return target; - } - - /** - * @param params the params string passed to "parse". - * @return a parameter iterator, with the whois target already - * stripped off. - * */ - protected ParameterIterator getParams( String params ) - { - ParameterIterator pi = new ParameterIterator(params); - pi.next(); // throw away our own nick - this.target = (String)pi.next(); - //log.debug("AbstractWhoisReply: Whois target: " + target); - - return pi; - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AwayReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AwayReply.java deleted file mode 100644 index a7105546e..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/AwayReply.java +++ /dev/null @@ -1,49 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals an automated AWAY message received as a response to a PRIVMSG that was sent out. - * - * @author Daniel Henninger - */ -public class AwayReply extends GenericReply -{ - - private String nick; - private String message; - - /** - * Factory constructor. - */ - public AwayReply() - { - } - - public AwayReply(String nick, String message) - { - this.nick = nick; - this.message = message; - } - - public String getIrcIdentifier() - { - return "301"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new AwayReply(getParameter(params, 1), getParameter(params, 2)); - } - - public String getNick() - { - return nick; - } - - public String getMessage() - { - return message; - } - -} diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ChannelCreationReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ChannelCreationReply.java deleted file mode 100644 index 2dd89e1cd..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ChannelCreationReply.java +++ /dev/null @@ -1,78 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import java.util.Date; -import java.util.StringTokenizer; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.clientstate.Channel; -import f00f.net.irc.martyr.clientstate.ClientState; - -/** - * ChannelCreationReply sets the creation time of the channel. It is sent - * automatically on a MODE discovery request. - */ -public class ChannelCreationReply extends GenericReply -{ - private String channelName; - private Date date; - - /** For use as a factory. */ - public ChannelCreationReply() - { - } - - public ChannelCreationReply( String channelName, Date date ) - { - this.channelName = channelName; - this.date = date; - } - - public String getIrcIdentifier() - { - return "329"; - } - - /** - * This is a factory that passes the command off to a - * ChannelModeCommand. - */ - public InCommand parse( String prefix, String identifier, String params ) - { - StringTokenizer tokens = new StringTokenizer( params ); - - // Our nick. We don't need that, I think. - tokens.nextToken(); - - // The channel. - String chan = tokens.nextToken(); - - // The date. - Date date; - try - { - date = new Date( Long.parseLong( tokens.nextToken() ) * 1000 ); - } - catch( NumberFormatException nfe ) - { - // riiiight... - date = new Date(0); - } - - return new ChannelCreationReply( chan, date ); - } - - /** - * This should, theoretically, never be called, because this command is - * only ever used as a factory. - */ - public boolean updateClientState( ClientState state ) - { - Channel channel = state.getChannel( channelName ); - channel.setCreationDate( date ); - return true; - } -} - - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericReply.java deleted file mode 100644 index eabdf2658..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericReply.java +++ /dev/null @@ -1,16 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.commands.AbstractInCommand; - -/** - * Defines what a reply is. A reply is really the same as an error, - * it just doesn't signify an error. - */ -public abstract class GenericReply extends AbstractInCommand -{ - - -} - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericStringReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericStringReply.java deleted file mode 100644 index 38d609ac6..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/GenericStringReply.java +++ /dev/null @@ -1,23 +0,0 @@ -package f00f.net.irc.martyr.replies; - -public abstract class GenericStringReply extends GenericReply -{ - - private String string; - - public GenericStringReply() - { - } - - public GenericStringReply( String string ) - { - this.string = string; - } - - public String getString() - { - return string; - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserClientReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserClientReply.java deleted file mode 100644 index c108fe919..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserClientReply.java +++ /dev/null @@ -1,28 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -public class LUserClientReply extends GenericStringReply -{ - - public LUserClientReply() - { - } - - public LUserClientReply( String string ) - { - super( string ); - } - - public String getIrcIdentifier() - { - return "251"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new LUserClientReply( getParameter( params, 1 ) ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserMeReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserMeReply.java deleted file mode 100644 index 9083f0a73..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserMeReply.java +++ /dev/null @@ -1,28 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -public class LUserMeReply extends GenericStringReply -{ - - public LUserMeReply() - { - } - - public LUserMeReply( String string ) - { - super( string ); - } - - public String getIrcIdentifier() - { - return "255"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new LUserMeReply( getParameter( params, 1 ) ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserOpReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserOpReply.java deleted file mode 100644 index b05efedc1..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/LUserOpReply.java +++ /dev/null @@ -1,36 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -public class LUserOpReply extends GenericStringReply -{ - - private int numOps; - - public LUserOpReply() - { - } - - public LUserOpReply( int ops, String string ) - { - super( string ); - this.numOps = ops; - } - - public String getIrcIdentifier() - { - return "252"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new LUserOpReply( getIntParameter( params, 1, -1 ), getParameter( params, 2 ) ); - } - - public int getNumOps() - { - return numOps; - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListEndReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListEndReply.java deleted file mode 100644 index 6a0b1ca7f..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListEndReply.java +++ /dev/null @@ -1,31 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals the end of a LIST response. - * - * @author Daniel Henninger - */ -public class ListEndReply extends GenericReply -{ - - /** - * Factory constructor. - */ - public ListEndReply() - { - } - - public String getIrcIdentifier() - { - return "323"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new ListEndReply(); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListReply.java deleted file mode 100644 index a814c5a43..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListReply.java +++ /dev/null @@ -1,63 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals an entry of a LIST response. - * - * @author Daniel Henninger - */ -public class ListReply extends GenericReply -{ - - private String requestor; - private String channel; - private Integer memberCount; - private String topic; - - /** - * Factory constructor. - */ - public ListReply() - { - } - - public ListReply(String requestor, String channel, Integer memberCount, String topic) - { - this.requestor = requestor; - this.channel = channel; - this.memberCount = memberCount; - this.topic = topic; - } - - public String getIrcIdentifier() - { - return "322"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new ListReply(getParameter(params, 0), getParameter(params, 1), Integer.parseInt(getParameter(params, 2)), getParameter(params, 3)); - } - - public String getChannel() - { - return channel; - } - - public Integer getMemberCount() - { - return memberCount; - } - - public String getTopic() - { - return topic; - } - - public String getRequestor() - { - return requestor; - } - -} diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListStartReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListStartReply.java deleted file mode 100644 index 0f00d6c3f..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ListStartReply.java +++ /dev/null @@ -1,31 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals the beginning of a LIST response. - * - * @author Daniel Henninger - */ -public class ListStartReply extends GenericReply -{ - - /** - * Factory constructor. - */ - public ListStartReply() - { - } - - public String getIrcIdentifier() - { - return "321"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new ListStartReply(); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ModeReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ModeReply.java deleted file mode 100644 index d355e45e3..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/ModeReply.java +++ /dev/null @@ -1,54 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import java.util.StringTokenizer; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.clientstate.ClientState; -import f00f.net.irc.martyr.commands.ChannelModeCommand; - -/** - * ModeReply is really a factory that passes the ModeReply off to a - * ChannelModeCommand. - */ -public class ModeReply extends GenericReply -{ - - /** For use as a factory. */ - public ModeReply() - { - } - - public String getIrcIdentifier() - { - return "324"; - } - - /** - * This is a factory that passes the command off to a - * ChannelModeCommand. - */ - public InCommand parse( String prefix, String identifier, String params ) - { - StringTokenizer tokens = new StringTokenizer( params ); - - // Our nick. We don't need that, I think. - tokens.nextToken(); - - String chan = tokens.nextToken(); - - return new ChannelModeCommand( prefix, chan, tokens ); - } - - /** - * This should, theoretically, never be called, because this command is - * only ever used as a factory. - */ - public boolean updateClientState( ClientState state ) - { - throw new IllegalStateException("This shouldn't be called!" ); - } -} - - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesEndReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesEndReply.java deleted file mode 100644 index a0605b5bd..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesEndReply.java +++ /dev/null @@ -1,47 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -public class NamesEndReply extends GenericReply -{ - - private String channel; - private String comment; - - /** For use as a factory. */ - public NamesEndReply() - { - this( null, null ); - } - - public NamesEndReply( String channel, String comment ) - { - this.channel = channel; - this.comment = comment; - } - - public String getIrcIdentifier() - { - return "366"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new NamesEndReply( getParameter( params, 1 ), getParameter( params, 2 ) ); - } - - public String getChannel() - { - return channel; - } - - public String getComment() - { - return comment; - } - -} - - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesReply.java deleted file mode 100644 index acd5045f6..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NamesReply.java +++ /dev/null @@ -1,89 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import java.util.List; -import java.util.Arrays; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.clientstate.Channel; -import f00f.net.irc.martyr.clientstate.ClientState; -import java.util.logging.Logger; - -public class NamesReply extends GenericReply -{ - static Logger log = Logger.getLogger(NamesReply.class.getName()); - - private List<String> names; - private String channel; - - /** For use as a factory. */ - public NamesReply() - { - } - - public NamesReply( String channel, List<String> names ) - { - this.names = names; - this.channel = channel; - } - - public String getIrcIdentifier() - { - return "353"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new NamesReply( getParameter( params, 2 ), Arrays.asList(getParameter( params, 3 ).split(" ")) ); - } - - /** - * Adds the list of names to the client state. - */ - public boolean updateClientState( ClientState state ) - { - boolean stateChanged = false; - - // 1) Get the Channel - Channel channelObj = state.getChannel( channel ); - - if( channel == null ) - { - log.severe("NamesReply: Channel is null"); - return false; - } - - if( channelObj == null ) - { - log.severe("NamesReply: No channel object for channel: " + channel); - return false; - } - - - // 2) Parse out names - for (String nick : names) { - // 3) Check that the user is not already in the list - if( !channelObj.isMemberInChannel( nick ) ) - { - channelObj.addMember( nick, this ); - stateChanged = true; - } - } - - return stateChanged; - } - - public List<String> getNames() - { - return names; - } - - public String getChannel() - { - return channel; - } - -} - - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NowAwayReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NowAwayReply.java deleted file mode 100644 index 012431112..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/NowAwayReply.java +++ /dev/null @@ -1,43 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals that you were successfully marked un-away. - * - * @author Daniel Henninger - */ -public class NowAwayReply extends GenericReply -{ - - /* Should always be You have been marked as being away */ - private String message; - - /** - * Factory constructor. - */ - public NowAwayReply() - { - } - - public NowAwayReply(String message) - { - this.message = message; - } - - public String getIrcIdentifier() - { - return "306"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new NowAwayReply(getParameter(params, 0)); - } - - public String getMessage() - { - return message; - } - -} diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/TopicInfoReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/TopicInfoReply.java deleted file mode 100644 index 311e17dc8..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/TopicInfoReply.java +++ /dev/null @@ -1,80 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import java.util.Date; -import java.util.StringTokenizer; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.clientstate.Channel; -import f00f.net.irc.martyr.clientstate.ClientState; - -/** - * Contains info about the topic, who set it and when. - */ -public class TopicInfoReply extends GenericReply -{ - private String channelName; - private Date date; - private String author; - - /** For use as a factory. */ - public TopicInfoReply() - { - } - - public TopicInfoReply( String channelName, Date date, String author ) - { - this.channelName = channelName; - this.date = date; - this.author = author; - } - - public String getIrcIdentifier() - { - return "333"; - } - - public String getChannel() - { - return this.channelName; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - StringTokenizer tokens = new StringTokenizer( params ); - - // Our nick. We don't need that, I think. - tokens.nextToken(); - - // The channel. - String chan = tokens.nextToken(); - - // The author - String author = tokens.nextToken(); - - // The date. - Date date; - try - { - date = new Date( Long.parseLong( tokens.nextToken() ) * 1000 ); - } - catch( NumberFormatException nfe ) - { - // riiiight... - date = new Date(0); - } - - return new TopicInfoReply( chan, date, author ); - } - - public boolean updateClientState( ClientState state ) - { - Channel channel = state.getChannel( channelName ); - channel.setTopicDate( date ); - channel.setTopicAuthor( author ); - return true; - } -} - - - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnAwayReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnAwayReply.java deleted file mode 100644 index f4652f0ce..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnAwayReply.java +++ /dev/null @@ -1,43 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; - -/** - * Signals that you were successfully marked un-away. - * - * @author Daniel Henninger - */ -public class UnAwayReply extends GenericReply -{ - - /* Should always be You are no longer marked as being away */ - private String message; - - /** - * Factory constructor. - */ - public UnAwayReply() - { - } - - public UnAwayReply(String message) - { - this.message = message; - } - - public String getIrcIdentifier() - { - return "305"; - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new UnAwayReply(getParameter(params, 0)); - } - - public String getMessage() - { - return message; - } - -} diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnknownReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnknownReply.java deleted file mode 100644 index f4ebc14d6..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/UnknownReply.java +++ /dev/null @@ -1,66 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.State; -import f00f.net.irc.martyr.commands.UnknownCommand; - - -/** - * A container for unknown replies. - */ -public class UnknownReply extends UnknownCommand -{ - private String replyStr; - private int replyCode; - - public UnknownReply( String ident ) - { - replyStr = ident; - replyCode = Integer.parseInt( ident ); - } - - public int getReplyCode() - { - return replyCode; - } - - public String getReply() - { - return replyStr; - } - - public static boolean isReply( String ident ) - { - char c = ident.charAt(0); - return ( c == '0' || c == '2' || c == '3' ); - } - - public State getState() - { - return State.UNKNOWN; - } - - /** - * Never parsed. - */ - public InCommand parse( String prefix, String identifier, String params ) - { - throw new UnsupportedOperationException("UnknownReply does no parsing."); - } - - /** - * Unknown, so we don't know what the identifier is ahead of time. - */ - public String getIrcIdentifier() - { - return replyStr; - } - - public String toString() - { - return "UnknownReply[" + replyStr + "]"; - } - -} - - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisChannelsReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisChannelsReply.java deleted file mode 100644 index 0eee5eb2f..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisChannelsReply.java +++ /dev/null @@ -1,70 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.util.ParameterIterator; -import java.util.HashSet; -import java.util.Set; -import java.util.StringTokenizer; - -//import org.apache.log4j.Logger; - -public class WhoisChannelsReply extends AbstractWhoisReply -{ - //static Logger log = Logger.getLogger(WhoisChannelsReply.class); - - private String channels; - - /** - * Factory constructor. - * */ - public WhoisChannelsReply() - { - } - - public WhoisChannelsReply( String params ) - { - super( params ); - } - - public String getIrcIdentifier() - { - return "319"; - } - - /** - * @return a space-delimited list of channels - * */ - public String getChannels() - { - return channels; - } - - /** - * @return a set of Strings of channels - * */ - public Set<String> getChannelSet() - { - StringTokenizer tokens = new StringTokenizer( channels ); - Set<String> set = new HashSet<String>(); - while( tokens.hasMoreTokens() ) - { - set.add( tokens.nextToken() ); - } - - return set; - } - - protected void parseParams( ParameterIterator pi ) - { - channels = pi.last(); // Channels - - //log.debug("WhoisChannelsReply: channels: " + channels); - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new WhoisChannelsReply( params ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisEndReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisEndReply.java deleted file mode 100644 index ce9def847..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisEndReply.java +++ /dev/null @@ -1,37 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.util.ParameterIterator; - -public class WhoisEndReply extends AbstractWhoisReply -{ - /** - * Factory constructor. - * */ - public WhoisEndReply() - { - } - - public WhoisEndReply( String params ) - { - super( params ); - } - - public String getIrcIdentifier() - { - return "318"; - } - - - protected void parseParams( ParameterIterator pi ) - { - // nothing to do here - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new WhoisEndReply( params ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisIdleReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisIdleReply.java deleted file mode 100644 index aba98205d..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisIdleReply.java +++ /dev/null @@ -1,68 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.util.ParameterIterator; -import java.util.Date; - -//import org.apache.log4j.Logger; - -public class WhoisIdleReply extends AbstractWhoisReply -{ - //static Logger log = Logger.getLogger(WhoisIdleReply.class); - - private int idleTime; - private Date loginTime; - - /** - * Factory constructor. - * */ - public WhoisIdleReply() - { - } - - public WhoisIdleReply( String params ) - { - super( params ); - } - - public String getIrcIdentifier() - { - return "317"; - } - - /** - * @return seconds idle - * */ - public int getIdleTime() - { - return idleTime; - } - - /** - * @return login time, if provided, null otherwise - * */ - public Date getLoginTime() - { - return loginTime; - } - - protected void parseParams( ParameterIterator pi ) - { - String idleTimeStr = (String)pi.next(); // Idle name - idleTime = Integer.parseInt( idleTimeStr ); - if( pi.hasNext() && ! pi.nextIsLast() ) - { - String loginTimeStr = (String)pi.next(); // Idle description - loginTime = new Date( Long.parseLong( loginTimeStr ) * 1000 ); - } - //log.debug("WhoisIdleReply: idle: " + idleTime); - //log.debug("WhoisIdleReply: login: " + loginTime); - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new WhoisIdleReply( params ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisServerReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisServerReply.java deleted file mode 100644 index d1f4d6344..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisServerReply.java +++ /dev/null @@ -1,61 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.util.ParameterIterator; -//import org.apache.log4j.Logger; - -public class WhoisServerReply extends AbstractWhoisReply -{ - //static Logger log = Logger.getLogger(WhoisServerReply.class); - - private String serverName; - private String serverDesc; - - /** - * Factory constructor. - * */ - public WhoisServerReply() - { - } - - public WhoisServerReply( String params ) - { - super( params ); - } - - public String getIrcIdentifier() - { - return "312"; - } - - /** - * @return the DNS name of the server - * */ - public String getServerName() - { - return serverName; - } - - /** - * @return the free-form description of the server - * */ - public String getServerDescription() - { - return serverDesc; - } - - protected void parseParams( ParameterIterator pi ) - { - serverName = (String)pi.next(); // Server name - serverDesc = (String)pi.next(); // Server description - //log.debug("WhoisServerReply: server name: " + serverName); - //log.debug("WhoisServerReply: server desc: " + serverDesc); - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new WhoisServerReply( params ); - } - -} - diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisUserReply.java b/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisUserReply.java deleted file mode 100644 index a896c65e6..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/replies/WhoisUserReply.java +++ /dev/null @@ -1,54 +0,0 @@ -package f00f.net.irc.martyr.replies; - -import f00f.net.irc.martyr.InCommand; -import f00f.net.irc.martyr.util.ParameterIterator; - -public class WhoisUserReply extends AbstractWhoisReply -{ - - private String host; - private String name; - - /** - * Factory constructor. - * */ - public WhoisUserReply() - { - } - - public WhoisUserReply( String params ) - { - super( params ); - } - - public String getIrcIdentifier() - { - return "311"; - } - - protected void parseParams( ParameterIterator pi ) - { - pi.next(); // throw away the nick - host = (String)pi.next(); // hostmask - //log.debug("WhoisUserReply: host: " + host); - name = pi.last(); // the "Name" - //log.debug("WhoisUserReply: name: " + name); - } - - public InCommand parse( String prefix, String identifier, String params ) - { - return new WhoisUserReply( params ); - } - - public String getHost() - { - return host; - } - - public String getName() - { - return name; - } - -} - |