module XMPP::Stanza::Attrs
Overview
Attrs represents the common structure for base XMPP packets.
"Type" Attribute
Common uses of the message stanza in instant messaging applications
include: single messages; messages sent in the context of a one-to-one
chat session; messages sent in the context of a multi-user chat room;
alerts, notifications, or other information to which no reply is expected;
and errors. These uses are differentiated via the #type
attribute. If
included, the #type
attribute MUST have one of the following values:
-
:chat
-- The message is sent in the context of a one-to-one chat session. Typically a receiving client will present message of typechat
in an interface that enables one-to-one chat between the two parties, including an appropriate conversation history. -
:error
-- The message is generated by an entity that experiences an error in processing a message received from another entity. A client that receives a message of typeerror
SHOULD present an appropriate interface informing the sender of the nature of the error. -
: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 typegroupchat
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. -
: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). -
: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 typenormal
in an interface that enables the recipient to reply, but without a conversation history. The default value of the#type
attribute isnormal
.
"To" Attribute
An instant messaging client specifies an intended recipient for a message
by providing the JID of an entity other than the sender in the #to
attribute of the Message stanza. If the message is being sent outside the
context of any existing chat session or received message, the value of the
#to
address SHOULD be of the form "user@domain" rather than of the form
"user@domain/resource".
Direct including types
Defined in:
xmpp/stanza/packet.crInstance Method Summary
- #attr_hash
- #from : String
- #from=(from : String)
- #id : String
- #id=(id : String)
- #lang : String
- #lang=(lang : String)
- #load_attrs(node : XML::Node)
- #to : String
- #to=(to : String)
- #type : String
- #type=(type : String)
- #xmlns : String