| Class Jabber::Protocol::Message |
|
| Methods |
| Attributes |
| body | [RW] | |
| error | [RW] | |
| errorcode | [RW] | |
| from | [RW] | |
| id | [RW] | |
| oobData | [RW] | |
| subject | [RW] | |
| thread | [RW] | |
| to | [RW] | |
| type | [RW] | |
| x | [RW] | |
| xhtml | [RW] |
| Public Class methods |
| from_element(session, element) |
Factory to build a Message from an XMLElement
| session: | [Jabber::Session] The Jabber session instance |
| element: | [Jabber::Protocol::ParsedXMLElement] The received XML object |
| return: | [Jabber::Protocol::Message] The newly created Message object |
| new(to, type=NORMAL) |
Creates a Message
| to: | [String | Jabber::JID] The jabber id to send this message to (or from) |
| type: | [Integer=NORMAL] The type of message...Message::(NORMAL, CHAT, GROUPCHAT, HEADLINE) |
| Public Instance methods |
| set_body(body) |
Chaining method...sets the body of the message
| body: | [String] The message body |
| return: | [Jabber::Protocol::Message] The current Message object |
| set_subject(subject) |
Chaining method...sets the subject of the message
| subject: | [String] The message subject |
| return: | [Jabber::Protocol::Message] The current Message object |
| set_xhtml(xhtml) |
Chaining method...sets the XHTML body of the message
| body: | [String] The message body |
| return: | [Jabber::Protocol::Message] The current message object |
| set_thread(thread) |
Chaining method...sets the thread of the message
| thread: | [String] The message thread id |
| return: | [Jabber::Protocol::Message] The current Message object |
| set_outofband(data) |
Chaining method...sets the OOB data of the message
| data: | [String] The message OOB data |
| return: | [Jabber::Protocol::Message] The current Message object |
| set_x(x) |
Chaining method...sets the extended data of the message
| x: | [String] The message x data |
| return: | [Jabber::Protocol::Message] The current Message object |
| set_error(code,reason) |
Sets an error code to be returned(chaining method)
| code: | [Integer] the jabber error code |
| reason: | [String] Why the error was reported |
| return: | [Jabber::Protocol::Message] The current Message object |
| request(ttl=nil, &block) |
Convenience method for send(true)
| ttl: | [Integer = nil] The time (in seconds) to wait for a reply before assuming nil |
| &block: | [Block] A block to process the message replies |
| send(wait=false, ttl=nil, &block) |
Sends the message to the Jabber service for delivery
| wait: | [Boolean = false] Wait for reply before return? |
| ttl: | [Integer = nil] The time (in seconds) to wait for a reply before assuming nil |
| &block: | [Block] A block to process the message replies |
| session=(session) |
Sets the session instance
| session: | [Jabber::Session] The session instance |
| return: | [Jabber::Protocol::Message] The current Message object |
| reply() |
Builds a reply to an existing message by setting:
| return: | [Jabber::Protocol::Message] The reply message |
| to_xml() |
Generates XML that complies with the Jabber protocol for sending the message through the Jabber service.
| return: | [String] The XML string. |
| to_s() |
see to_xml