summaryrefslogtreecommitdiffstats
path: root/EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-10-12 05:00:36 +0200
committersnowleo <schneeleo@gmail.com>2011-10-12 05:00:36 +0200
commit93128712506bb0d4d422553b0480195cfd2cc9b3 (patch)
treeb43500e52a607ceca0781062ac17570fdf1d4ab7 /EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java
parent860d446d28776ec842fa53e8e08538d4e093d6e9 (diff)
downloadEssentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar
Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.gz
Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.lz
Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.xz
Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.zip
Replacing martyr with Pircbot 1.5
Diffstat (limited to 'EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java')
-rw-r--r--EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java127
1 files changed, 0 insertions, 127 deletions
diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java b/EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java
deleted file mode 100644
index 3d66f7c21..000000000
--- a/EssentialsUpdate/src/f00f/net/irc/martyr/commands/MessageCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package f00f.net.irc.martyr.commands;
-
-import f00f.net.irc.martyr.InCommand;
-import f00f.net.irc.martyr.clientstate.ClientState;
-import f00f.net.irc.martyr.util.FullNick;
-
-
-/**
- * Defines the PRIVMSG command. Messages can be sent to groups or to users.
- */
-public class MessageCommand extends AbstractCommand
-{
-
- private FullNick from;
- private String dest;
- private String message;
-
-
- /** Factory */
- public MessageCommand()
- {
- from = null;
- dest = null;
- message = null;
- }
-
- /**
- * Used to send a message.
- *
- * @param dest Target for message
- * @param message Message to be sent
- */
- public MessageCommand( String dest, String message )
- {
- this( null, dest, message );
- }
-
- /**
- * Used to send a message.
- *
- * @param dest Target for message
- * @param message Message to be sent
- */
- public MessageCommand( FullNick dest, String message )
- {
- this( dest.getNick(), message );
- }
-
- public MessageCommand( FullNick source, String dest, String message )
- {
- this.from = source;
- this.dest = dest;
- this.message = message;
- }
-
- /**
- * Parses a string and produces a formed command object, if it can.
- * Should return null if it cannot form the command object.
- */
- public InCommand parse( String prefix, String identifier, String params )
- {
- FullNick from;
- if( prefix == null || prefix.trim().length() == 0 )
- {
- from = null;
- }
- else
- {
- from = new FullNick( prefix );
- }
- String dest = getParameter( params, 0 );
- String msg = getParameter( params, 1 );
-
- if( CtcpMessage.isCtcpString( msg ) )
- {
- return new CtcpMessage( from, dest, msg );
- }
-
- return new MessageCommand( from, dest, msg );
- }
-
- /**
- * Returns the string IRC uses to identify this command. Examples:
- * NICK, PING, KILL, 332
- */
- public String getIrcIdentifier()
- {
- return "PRIVMSG";
- }
-
- /**
- * Renders the parameters of this command.
- */
- public String renderParams()
- {
- return dest + " :" + message;
- }
-
- public FullNick getSource()
- {
- return from;
- }
-
- public String getDest()
- {
- return dest;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- /**
- * Returns true if the message is both private and for us.
- *
- * @param state Client state to compare with
- * @return True or false if this is a private message to us
- */
- public boolean isPrivateToUs( ClientState state )
- {
- return state.getNick().equals( dest );
- }
-
-}
-
-