Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.irc
Class MessageIrcImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractMessage
      extended by net.java.sip.communicator.impl.protocol.irc.MessageIrcImpl
All Implemented Interfaces:
Message

public class MessageIrcImpl
extends AbstractMessage

Very simple message implementation for the IRC protocol.

Author:
Stephane Remy, Loic Kempf, Lubomir Marinov

Field Summary
static String DEFAULT_MIME_ENCODING
          Default encoding for outgoing messages.
static String DEFAULT_MIME_TYPE
          Default mime type for outgoing messages.
 
Constructor Summary
MessageIrcImpl(String content, String contentType, String contentEncoding, String subject)
          Creates a message instance according to the specified parameters.
 
Method Summary
 boolean isAction()
          Checks if this message is an action.
 boolean isCommand()
          Checks if this message is a command.
protected  void setContent(String messageContent)
          Sets the content to this Message.
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractMessage
createMessageUID, getContent, getContentType, getEncoding, getMessageUID, getRawData, getSize, getSubject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIME_ENCODING

public static final String DEFAULT_MIME_ENCODING
Default encoding for outgoing messages.

See Also:
Constant Field Values

DEFAULT_MIME_TYPE

public static final String DEFAULT_MIME_TYPE
Default mime type for outgoing messages.

See Also:
Constant Field Values
Constructor Detail

MessageIrcImpl

public MessageIrcImpl(String content,
                      String contentType,
                      String contentEncoding,
                      String subject)
Creates a message instance according to the specified parameters.

Parameters:
content - the message body
contentType - message content type or null for text/plain
contentEncoding - message encoding or null for UTF8
subject - the subject of the message or null for no subject.
Method Detail

isCommand

public boolean isCommand()
Checks if this message is a command. In IRC all messages that start with the '/' character are commands.

Returns:
TRUE if this Message is a command, FALSE otherwise

isAction

public boolean isAction()
Checks if this message is an action. All message starting with '/me' are actions.

Returns:
TRUE if this message is an action, FALSE otherwise

setContent

protected void setContent(String messageContent)
Sets the content to this Message. Used to change the content, before showing action messages to the user.

Overrides:
setContent in class AbstractMessage
Parameters:
messageContent - the new message content

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.