com.zion.jbuddy
Interface IMessage


public interface IMessage

A message that is sent or received on the IM server.


Field Summary
static int AUTH_ACCEPT
          The message type for notices that the sender has accepted the recipient's request to add them to their Buddy List and view their online presence.
static int AUTH_DECLINE
          The message type for notices that the sender has declined the recipient's request to add them to their Buddy List and view their online presence.
static int AUTH_REPLY
          Deprecated. As of 2.1, use AUTH_ACCEPT or AUTH_DECLINE.
static int AUTH_REQUEST
          The message type for notices that the sender is requesting the recipient's authorization to add them to their Buddy List and view their online presence.
static int AUTO_RESPONSE
          The message type for messages sent in response to other messages.
static int CUSTOM_AWAY
          The message type for AIM custom away message responses.
static int ERROR
          The message type for error messages.
static int IM
          The message type for Instant Messages.
static int IM_OFFLINE
          The message type for messages that are received while the client is offline.
static int TYPING
          The message type for notices that the sender is typing a message.
static int TYPING_OFF
          The message type for notices that the sender has paused or stopped typing a message.
static int WARNING
          The message type for warning messages.
 
Method Summary
 String getMessage()
          Returns the contents of this message.
 String getRecipient()
          Returns the unique name of the user who is to receive this message.
 RichContent getRichContent()
          Returns this message's rich content.
 String getSender()
          Returns the unique name of the user who is sending this message.
 int getSeqNum()
          Returns this message's sequence number.
 Date getTimeStamp()
          Returns the date and time when this message was sent (for outgoing messages) or received (for incoming messages).
 int getType()
          Returns this message's type.
 boolean isAutoResponse()
          Deprecated. Automatic response messages will return the AUTO_RESPONSE type.
 

Field Detail

IM

static final int IM
The message type for Instant Messages.

Since:
2.0
See Also:
Constant Field Values

IM_OFFLINE

static final int IM_OFFLINE
The message type for messages that are received while the client is offline. These messages are forwarded to the client the next time they sign on.

As of 6.1, for AIM and ICQ, IM_OFFLINE can be used to allow a message to be sent to an offline user (they'll receive the message next time they sign on). Normal IMs sent to offline users will cause the server to return an error.

Valid for ICQ, JABBER, YIM.

Since:
2.0 (YIM), 2.1 (ICQ), 5.1 (JABBER), 6.1 (AIM)
See Also:
Constant Field Values

AUTO_RESPONSE

static final int AUTO_RESPONSE
The message type for messages sent in response to other messages. A user that has a status of AWAY may send an automatic response to incoming instant messages, containing their current away message.

Since:
2.0
See Also:
Constant Field Values

TYPING

static final int TYPING
The message type for notices that the sender is typing a message.

Since:
2.0 (AIM, JSC, MSN, YIM), 2.1 (ICQ), 2.2 (SAMETIME), 5.0 (JABBER)
See Also:
Constant Field Values

TYPING_OFF

static final int TYPING_OFF
The message type for notices that the sender has paused or stopped typing a message.

Valid for AIM, ICQ, JABBER, SAMETIME, YIM.

Since:
2.0 (AIM, YIM), 2.1 (ICQ), 2.2 (SAMETIME), 5.0 (JABBER)
See Also:
Constant Field Values

CUSTOM_AWAY

static final int CUSTOM_AWAY
The message type for AIM custom away message responses. This is sent to the client after requesting the away message from the server.

Valid for AIM.

Since:
2.1
See Also:
IAimClient.requestAwayMessage(java.lang.String), Constant Field Values

AUTH_ACCEPT

static final int AUTH_ACCEPT
The message type for notices that the sender has accepted the recipient's request to add them to their Buddy List and view their online presence.

For MSN, this causes the recipient to be added to our Permit List.

Valid for ICQ, JABBER, LCS (receive only), MSN (send only), YIM.

Since:
2.1 (ICQ, MSN), 2.2 (JABBER), 5.0 (YIM), 6.0 (LCS)
See Also:
Constant Field Values

AUTH_DECLINE

static final int AUTH_DECLINE
The message type for notices that the sender has declined the recipient's request to add them to their Buddy List and view their online presence.

For MSN, this causes the recipient to be added to our Deny List.

Valid for ICQ, JABBER, LCS (receive only), MSN (send only), YIM.

Since:
2.1 (ICQ, MSN, YIM), 2.2 (JABBER), 6.0 (LCS)
See Also:
Constant Field Values

AUTH_REQUEST

static final int AUTH_REQUEST
The message type for notices that the sender is requesting the recipient's authorization to add them to their Buddy List and view their online presence.

This notice is automatically sent when attempting to add a user to your Buddy List, and doesn't explicitly need to be sent, unless you wish to re-request authorization from that user later.

AIM does not currently support notification when a user has added you to their Buddy List.

On MSN, you receive this message only when your Reverse List prompt is true (it is by default), your name has been added to the sender's Buddy List, and the sender's name is not in your Permit List. Authorization is accepted if you add the sender to your Permit List, and declined if you add them to your Deny List.

Valid for ICQ, JABBER, LCS (receive only), MSN (receive only), YIM (receive only).

Since:
2.0 (MSN), 2.1 (ICQ, YIM), 2.2 (JABBER), 6.0 (LCS)
See Also:
Constant Field Values

AUTH_REPLY

static final int AUTH_REPLY
Deprecated. As of 2.1, use AUTH_ACCEPT or AUTH_DECLINE.
The message type for notices that the sender is replying to the recipient's request to add them to their Buddy List.

Valid for ICQ, MSN.

Since:
2.0
See Also:
Constant Field Values

WARNING

static final int WARNING
The message type for warning messages.

If the message was received in incomingMessage, it indicates a warning issued by another user. If it was received in adminMessage, it is a system warning message.

For AIM and ICQ, a system warning is sent when you exceed the server rate limit (by sending too many messages in a short amount of time). It also indicates that a message was dropped by the server. If this happens, you should stop sending messages for 20-30 seconds or more; otherwise, you risk having further messages dropped, or being disconnected from the server.

Since:
2.0
See Also:
IAimClient.warnUser(java.lang.String, boolean), IJscClient.warnUser(java.lang.String, boolean), Constant Field Values

ERROR

static final int ERROR
The message type for error messages.

Since:
2.0
See Also:
Constant Field Values
Method Detail

getType

int getType()
Returns this message's type.

Since:
2.0

getSender

String getSender()
Returns the unique name of the user who is sending this message.


getRecipient

String getRecipient()
Returns the unique name of the user who is to receive this message.


getMessage

String getMessage()
Returns the contents of this message. The contents may contain various markup, depending on the client's plain text mode.

See Also:
IClient.setPlainTextMode(int)

getRichContent

RichContent getRichContent()
                           throws Exception
Returns this message's rich content.

Returns:
the rich content, or null if there is none
Throws:
Exception - if the rich content could not be parsed
Since:
5.0

getTimeStamp

Date getTimeStamp()
Returns the date and time when this message was sent (for outgoing messages) or received (for incoming messages).

Returns:
the date and time
Since:
2.0

isAutoResponse

boolean isAutoResponse()
Deprecated. Automatic response messages will return the AUTO_RESPONSE type.

Returns true if this message is an automatic response.

Valid for AIM, YIM.


getSeqNum

int getSeqNum()
Returns this message's sequence number.

This number increases for subsequent messages, and is unique for each message received by a particular client. If this message will be sent through a client, its sequence number will be -1 until it has been successfully sent.



JBuddy is a trademark of Zion Software, LLC in the US and other countries.
Copyright 2000-2012 Zion Software, LLC All Rights Reserved.