Package | org.igniterealtime.xiff.data |
Class | public class Message |
Inheritance | Message ![]() ![]() ![]() ![]() |
Implements | IMessage |
See also
Property | Defined By | ||
---|---|---|---|
attention : Boolean
Messages containing an attention extension SHOULD use the headline message
type to avoid offline storage. | Message | ||
body : String
The message body in plain-text format. | Message | ||
correction : Boolean
When sending a message, people often introduce typing errors and send a follow-up message to correct them. | Message | ||
correctionId : String
Message ID of the message that is to be corrected. | Message | ||
![]() | errorCode : int
The error code, assuming this stanza contains error information. | XMPPStanza | |
![]() | errorCondition : String
The error condition, assuming this stanza contains error information. | XMPPStanza | |
![]() | errorMessage : String
The error message, assuming this stanza contains error information. | XMPPStanza | |
![]() | errorType : String
The error type, assuming this stanza contains error information. | XMPPStanza | |
![]() | from : EscapedJID
The JID of the sender. | XMPPStanza | |
htmlBody : String
The message body in XHTML format. | Message | ||
![]() | id : String
The unique identifier of this stanza. | XMPPStanza | |
idGenerator : IIDGenerator [static]
The ID generator for this stanza type. | Message | ||
receipt : String
XEP-0184: Message Delivery Receipts
This XMPP protocol extension for message delivery receipts,
whereby the sender of a message can request notification that the
message has been delivered to a client controlled by the intended
recipient.
| Message | ||
receiptId : String
Message ID of the message that had receipt request. | Message | ||
state : String
The chat state if any. | Message | ||
subject : String
The message subject. | Message | ||
thread : String
The message thread ID. | Message | ||
time : Date [read-only]
Time of the message in case of a delay. | Message | ||
![]() | to : EscapedJID
The JID of the recipient. | XMPPStanza | |
![]() | type : String
The stanza type. | XMPPStanza | |
![]() | xml : XML [override]
In addition to saving the XML, check for possible Extensions that are registered for listening this XML data. | XMPPStanza |
Method | Defined By | ||
---|---|---|---|
Message(recipient:EscapedJID = null, msgID:String = null, msgBody:String = null, msgHTMLBody:String = null, msgType:String = null, msgSubject:String = null, chatState:String = null)
A class for abstraction and encapsulation of message data. | Message | ||
![]() |
Add extension to the list of the given namespace and insert to the XML element as a child. | ExtensionContainer | |
generateID(prefix:String = null):String [static]
Generates a unique ID for the stanza. | Message | ||
![]() | getAllExtensions():Array | ExtensionContainer | |
![]() | getAllExtensionsByNS(nameSpace:String):Array | ExtensionContainer | |
![]() | getAttribute(name:String):String
Convinience method for getting element value from the XML. | XMLStanza | |
![]() | getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML. | XMLStanza | |
![]() | getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML. | XMLStanza | |
![]() | getExtension(elementName:String):IExtension
Get the extension having the given element name. | ExtensionContainer | |
![]() | getField(name:String):String
Convinience method for getting element value from the XML. | XMLStanza | |
![]() | removeAllExtensions(nameSpace:String):void | ExtensionContainer | |
![]() | removeExtension(extension:IExtension):Boolean | ExtensionContainer | |
![]() | removeFields(name:String):void
Helper method for removing all child elements that have the given name. | XMLStanza | |
![]() | setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML. | XMLStanza | |
![]() | setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML. | XMLStanza | |
![]() | setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML. | XMLStanza | |
![]() | setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML. | XMLStanza | |
![]() | toString():String
Converts the base stanza XML to a string. | XMLStanza |
Constant | Defined By | ||
---|---|---|---|
![]() | CLIENT_NAMESPACE : String = jabber:client [static] | XMPPStanza | |
![]() | CLIENT_VERSION : String = 1.0 [static]
The version of XMPP specified in RFC 3920 is "1.0"; in particular, this
encapsulates the stream-related protocols (Use of TLS (Section 5),
Use of SASL (Section 6), and Stream Errors (Section 4.7)), as well as
the semantics of the three defined XML stanza types (message,
presence, and iq). | XMPPStanza | |
![]() | DEFAULT_NS : Namespace [static]
Default XML namespace. | XMLStanza | |
![]() | ELEMENT_IQ : String = iq [static] | XMPPStanza | |
![]() | ELEMENT_MESSAGE : String = message [static] | XMPPStanza | |
![]() | ELEMENT_PRESENCE : String = presence [static] | XMPPStanza | |
![]() | ELEMENT_TEMP : String = temp [static]
Internal name in XIFF for incoming data. | XMPPStanza | |
![]() | ERROR_AUTH : String = auth [static]
Retry after providing credentials
| XMPPStanza | |
![]() | ERROR_CANCEL : String = cancel [static]
Do not retry (the error is unrecoverable)
| XMPPStanza | |
![]() | ERROR_CONTINUE : String = continue [static]
Proceed (the condition was only a warning)
| XMPPStanza | |
![]() | ERROR_MODIFY : String = modify [static]
Retry after changing the data sent
| XMPPStanza | |
![]() | ERROR_WAIT : String = wait [static]
Retry after waiting (the error is temporary)
| XMPPStanza | |
![]() | FLASH_NS : Namespace [static]
| XMLStanza | |
![]() | NAMESPACE_BOSH : String = urn:xmpp:xbosh [static] | XMPPStanza | |
![]() | NAMESPACE_FLASH : String = http://www.jabber.com/streams/flash [static] | XMPPStanza | |
![]() | NAMESPACE_STREAM : String = http://etherx.jabber.org/streams [static] | XMPPStanza | |
NS_ATTENTION : String = urn:xmpp:attention:0 [static]
The namespace used in the message delivery node. | Message | ||
NS_CORRECTION : String = urn:xmpp:message-correct:0 [static]
The namespace used in the XEP-0308: Last Message Correction. | Message | ||
NS_RECEIPT : String = urn:xmpp:receipts [static]
The namespace used in the message delivery node. | Message | ||
NS_STATE : String = http://jabber.org/protocol/chatstates [static]
The name space used in the Chat state node. | Message | ||
RECEIPT_RECEIVED : String = received [static]
Included by a receiving entity that wishes to inform the
sending entity that the message has been received. | Message | ||
RECEIPT_REQUEST : String = request [static]
Included by a sending entity that wishes to know if
the message has been received. | Message | ||
STATE_ACTIVE : String = active [static]
User is actively participating in the chat session. | Message | ||
STATE_COMPOSING : String = composing [static]
User is composing a message. | Message | ||
STATE_GONE : String = gone [static]
User has effectively ended their participation in the chat session. | Message | ||
STATE_INACTIVE : String = inactive [static]
User has not been actively participating in the chat session. | Message | ||
STATE_PAUSED : String = paused [static]
User had been composing but now has stopped. | Message | ||
![]() | STREAM_NS : Namespace [static]
| XMLStanza | |
TYPE_CHAT : String = chat [static]
The message is sent in the context of a one-to-one chat
session. | Message | ||
TYPE_ERROR : String = error [static]
The message is generated by an entity that experiences an
error in processing a message received from another entity (for
details regarding stanza error syntax, refer to [xmpp-core]). | Message | ||
TYPE_GROUPCHAT : String = groupchat [static]
The message is sent in the context of a multi-user
chat environment (similar to that of [IRC]). | Message | ||
TYPE_HEADLINE : String = headline [static]
The message provides an alert, a notification, or
other information to which no reply is expected (e.g., news
headlines, sports updates, near-real-time market data, and
syndicated content). | Message | ||
TYPE_NORMAL : String = normal [static]
The message is a standalone message that is sent outside
the context of a one-to-one conversation or groupchat, and to
which it is expected that the recipient will reply. | Message | ||
![]() | XML_LANG : String = en [static] | XMPPStanza |
attention | property |
attention:Boolean
Messages containing an attention extension SHOULD use the headline message
type to avoid offline storage. In case the attention
property is used,
type
is set to "headline" automatically.
However there is no check for the type when removing the attention, by setting it to false.
public function get attention():Boolean
public function set attention(value:Boolean):void
See also
body | property |
body:String
The message body in plain-text format. If a client cannot render HTML-formatted text, this text is typically used instead.
Use null
to remove.
public function get body():String
public function set body(value:String):void
correction | property |
correction:Boolean
When sending a message, people often introduce typing errors and send a follow-up message to correct them. This property allows the sending client to flag the second message as correcting the first.
public function get correction():Boolean
public function set correction(value:Boolean):void
See also
correctionId | property |
correctionId:String
Message ID of the message that is to be corrected.
public function get correctionId():String
public function set correctionId(value:String):void
See also
htmlBody | property |
htmlBody:String
The message body in XHTML format. Internally, this uses the XHTML data extension. TODO: Use extension registery to solve if the proper extension is enabled...
Use null
to remove.
public function get htmlBody():String
public function set htmlBody(value:String):void
See also
idGenerator | property |
idGenerator:IIDGenerator
The ID generator for this stanza type. ID generators must implement the IIDGenerator interface. The XIFF library comes with a few default ID generators that have already been implemented (see org.igniterealtime.xiff.data.id.. Setting the ID generator by stanza type is useful if you'd like to use different ID generation schemes for each type. For instance, messages could use the incremental ID generation scheme provided by the IncrementalGenerator class, while IQs could use the shared object ID generation scheme provided by the SOIncrementalGenerator class.
public static function get idGenerator():IIDGenerator
public static function set idGenerator(value:IIDGenerator):void
Message.idGenerator = new IncrementalGenerator();
receipt | property |
receipt:String
XEP-0184: Message Delivery Receipts
This XMPP protocol extension for message delivery receipts, whereby the sender of a message can request notification that the message has been delivered to a client controlled by the intended recipient.
public function get receipt():String
public function set receipt(value:String):void
See also
receiptId | property |
receiptId:String
Message ID of the message that had receipt request. Can be set only when the 'receipt' is Message.RECEIPT_RECEIVED.
While sending 'received', this property must be set to the message id that contained the 'request'.
public function get receiptId():String
public function set receiptId(value:String):void
See also
state | property |
state:String
The chat state if any. Possible values are:
Use null
to remove.
TODO: XEP states that this protocol SHOULD NOT be used with message types other than "chat" or "groupchat".
public function get state():String
public function set state(value:String):void
See also
subject | property |
subject:String
The message subject. Typically chat and groupchat-type messages do not use subjects. Rather, this is reserved for normal and headline-type messages.
Use null
to remove.
public function get subject():String
public function set subject(value:String):void
thread | property |
thread:String
The message thread ID. Threading is used to group messages of the same discussion together. The library does not perform message grouping, rather it is up to any client authors to properly perform this task.
Use null
to remove.
public function get thread():String
public function set thread(value:String):void
time | property |
time:Date
[read-only] Time of the message in case of a delay. Used only for messages which were sent while user was offline.
Can be set only via XML as the value should come from the server.
There are two ways that might be possible coming from the server, XEP-0203 or XEP-0091, of which the latter is legacy.
XEP-0203: CCYY-MM-DDThh:mm:ss[.sss]TZD
XEP-0091: CCYYMMDDThh:mm:ss
public function get time():Date
See also
Message | () | Constructor |
public function Message(recipient:EscapedJID = null, msgID:String = null, msgBody:String = null, msgHTMLBody:String = null, msgType:String = null, msgSubject:String = null, chatState:String = null)
A class for abstraction and encapsulation of message data.
The message stanza kind can be seen as a "push" mechanism whereby one entity pushes information to another entity, similar to the communications that occur in a system such as email. All message stanzas SHOULD possess a 'to' attribute that specifies the intended recipient of the message; upon receiving such a stanza, a server SHOULD route or deliver it to the intended recipient (see Server Rules for Handling XML Stanzas (Section 10) for general routing and delivery rules related to XML stanzas).
Parametersrecipient:EscapedJID (default = null ) — The JID of the message recipient
| |
msgID:String (default = null ) — The JID of the message sender - the server should report an error if this is falsified
| |
msgBody:String (default = null ) — The message ID
| |
msgHTMLBody:String (default = null ) — The message body in plain-text format
| |
msgType:String (default = null ) — The message body in XHTML format
| |
msgSubject:String (default = null ) — The message type
| |
chatState:String (default = null ) — (Optional) The message subject
|
generateID | () | method |
public static function generateID(prefix:String = null):String
Generates a unique ID for the stanza. ID generation is handled using a variety of mechanisms, but the default for the library uses the IncrementalGenerator.
Parameters
prefix:String (default = null ) — The prefix for the ID to be generated
|
String — The generated ID
|
NS_ATTENTION | Constant |
public static const NS_ATTENTION:String = urn:xmpp:attention:0
The namespace used in the message delivery node.
See also
NS_CORRECTION | Constant |
public static const NS_CORRECTION:String = urn:xmpp:message-correct:0
The namespace used in the XEP-0308: Last Message Correction.
See also
NS_RECEIPT | Constant |
public static const NS_RECEIPT:String = urn:xmpp:receipts
The namespace used in the message delivery node.
See also
NS_STATE | Constant |
public static const NS_STATE:String = http://jabber.org/protocol/chatstates
The name space used in the Chat state node.
See also
RECEIPT_RECEIVED | Constant |
public static const RECEIPT_RECEIVED:String = received
Included by a receiving entity that wishes to inform the sending entity that the message has been received.
The received element SHOULD be the only child of the message stanza and MUST mirror the 'id' of the sent message.
See also
RECEIPT_REQUEST | Constant |
public static const RECEIPT_REQUEST:String = request
Included by a sending entity that wishes to know if the message has been received.
See also
STATE_ACTIVE | Constant |
public static const STATE_ACTIVE:String = active
User is actively participating in the chat session.
STATE_COMPOSING | Constant |
public static const STATE_COMPOSING:String = composing
User is composing a message.
STATE_GONE | Constant |
public static const STATE_GONE:String = gone
User has effectively ended their participation in the chat session. Suggested delay after last activity some 10 minutes.
STATE_INACTIVE | Constant |
public static const STATE_INACTIVE:String = inactive
User has not been actively participating in the chat session. Suggested delay after last activity some 2 minutes.
STATE_PAUSED | Constant |
public static const STATE_PAUSED:String = paused
User had been composing but now has stopped. Suggested delay after last activity some 30 seconds.
TYPE_CHAT | Constant |
public static const TYPE_CHAT:String = chat
The message is sent in the context of a one-to-one chat session. Typically a receiving client will present message of type "chat" in an interface that enables one-to-one chat between the two parties, including an appropriate conversation history. Detailed recommendations regarding one-to-one chat sessions are provided under Section 5.1. of RFC 3921 (draft version).
See also
TYPE_ERROR | Constant |
public static const TYPE_ERROR:String = error
The message is generated by an entity that experiences an error in processing a message received from another entity (for details regarding stanza error syntax, refer to [xmpp-core]). A client that receives a message of type "error" SHOULD present an appropriate interface informing the sender of the nature of the error.
TYPE_GROUPCHAT | Constant |
public static const TYPE_GROUPCHAT:String = groupchat
The message is sent in the context of a multi-user chat environment (similar to that of [IRC]). Typically a receiving client will present a message of type "groupchat" in an interface that enables many-to-many chat between the parties, including a roster of parties in the chatroom and an appropriate conversation history. For detailed information about XMPP-based groupchat, refer to [XEP-0045].
See also
TYPE_HEADLINE | Constant |
public static const TYPE_HEADLINE:String = headline
The message provides an alert, a notification, or other information to which no reply is expected (e.g., news headlines, sports updates, near-real-time market data, and syndicated content). Because no reply to the message is expected, typically a receiving client will present a message of type "headline" in an interface that appropriately differentiates the message from standalone messages, chat messages, or groupchat messages (e.g., by not providing the recipient with the ability to reply). The receiving server SHOULD deliver the message to all of the recipient’s available resources.
TYPE_NORMAL | Constant |
public static const TYPE_NORMAL:String = normal
The message is a standalone message that is sent outside the context of a one-to-one conversation or groupchat, and to which it is expected that the recipient will reply. Typically a receiving client will present a message of type "normal" in an interface that enables the recipient to reply, but without a conversation history. The default value of the ’type’ attribute is "normal".