class XMPP::Stanza::Message

Overview

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.

Included Modules

Defined in:

xmpp/stanza/message.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module XMPP::Stanza::Attrs

attr_hash attr_hash, from : String from, from=(from : String) from=, id : String id, id=(id : String) id=, lang : String lang, lang=(lang : String) lang=, load_attrs(node : XML::Node) load_attrs, to : String to, to=(to : String) to=, type : String type, type=(type : String) type=, xmlns : String xmlns

Instance methods inherited from module XMPP::Stanza::Packet

name : String name, to_xml(xml : XML::Builder)
to_xml : String
to_xml

Instance methods inherited from module XMPP::Stanza::Packet

name : String name, to_xml(xml : XML::Builder)
to_xml : String
to_xml

Constructor Detail

def self.new(xml : String) #

[View source]
def self.new(node : XML::Node) #

[View source]

Class Method Detail

def self.xml_name : String #

[View source]

Instance Method Detail

def body : String #

[View source]
def body=(body : String) #

[View source]
def error : Error | Nil #

[View source]
def error=(error : Error | Nil) #

[View source]
def extensions : Array(Extension) #

[View source]
def extensions=(extensions : Array(Extension)) #

[View source]
def 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


[View source]
def name : String #

[View source]
def subject : String #

[View source]
def subject=(subject : String) #

[View source]
def thread : String #

[View source]
def thread=(thread : String) #

[View source]
def to_xml(elem : XML::Builder) #

[View source]
def xmpp_format #

[View source]