class

XMPP::Stanza::Message

Inherits XMPP::Stanza::Attrs / XMPP::Stanza::Packet / XMPP::Stanza::Extension / XMPP::Stanza::Packet / Reference / Object

Message Packet Message implements RFC 6120 - A.5 Client Namespace (a part) RFC 3921 Section 2.1 - Message Syntax

Exchanging messages is a basic use of XMPP and occurs when a user generates a message stanza that is addressed to another entity. The sender's server is responsible for delivering the message to the intended recipient (if the recipient is on the same local server) or for routing the message to the recipient's server (if the recipient is on a remote server). Thus a message stanza is used to "push" information to another entity.

"Subject" Element

The subject element contains human-readable XML character data that specifies the topic of the message.

"Body" Element

The body element contains human-readable XML character data that specifies the textual contents of the message; this child element is normally included but is optional.

"Thread" Element

The primary use of the XMPP thread element is to uniquely identify a conversation thread or "chat session" between two entities instantiated by Message stanzas of type chat. However, the XMPP thread element can also be used to uniquely identify an analogous thread between two entities instantiated by Message stanzas of type headline or normal, or among multiple entities in the context of a multi-user chat room instantiated by Message stanzas of type groupchat. It MAY also be used for Message stanzas not related to a human conversation, such as a game session or an interaction between plugins. The thread element is not used to identify individual messages, only conversations or messagingg sessions. The inclusion of the thread element is optional.

The value of the thread element is not human-readable and MUST be treated as opaque by entities; no semantic meaning can be derived from it, and only exact comparisons can be made against it. The value of the thread element MUST be a universally unique identifier (UUID) as described in [UUID].

The thread element MAY possess a 'parent' attribute that identifies another thread of which the current thread is an offshoot or child; the value of the 'parent' must conform to the syntax of the thread element itself.

Constructors

new(xml : String)
Source
new(node : XML::Node)
Source

Class methods

xml_name
Source

Instance methods

body
Source
body=(body : String)
Source
error
Source
error=(error : Error | Nil)
Source
extensions
Source
extensions=(extensions : Array(Extension))
Source
get(type : MsgExtension.class)

get search and extracts a specific extension on a message. it will return extension instance if found on message else return nil

Source
me?

me? reports whether the message body is a /me command per XEP-0245. A body is considered a /me command when it starts with the exact, case-sensitive string "/me " followed by some content.

Source
me_body

me_body returns the message body with the leading "/me " prefix removed. When the body is not a /me command the original body is returned.

Source
me_display(identity : String) : String

me_display formats a /me message body for presentation per XEP-0245, substituting the speaker's identity for the "/me " prefix: message.me_display("Juliet") # => "* Juliet dances a jig"

Source
name
Source
subject
Source
subject=(subject : String)
Source
thread
Source
thread=(thread : String)
Source
to_xml(xml : XML::Builder)
Source
xmpp_format
Source