Class Jabber::Protocol::Message
In: lib/jabber4r/protocol.rb
Parent: Object

Methods

from_element   new   reply   request   send   session=   set_body   set_error   set_outofband   set_subject   set_thread   set_x   set_xhtml   to_s   to_xml  

Constants

NORMAL = "normal"
ERROR = "error"
CHAT = "chat"
GROUPCHAT = "groupchat"
HEADLINE = "headline"

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

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

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

Builds a reply to an existing message by setting:

  1. to = from
  2. id = id
  3. thread = thread
  4. type = type
  5. session = session
return:[Jabber::Protocol::Message] The reply message

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

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

Sets the session instance

session:[Jabber::Session] The session instance
return:[Jabber::Protocol::Message] The current Message object

Chaining method...sets the body of the message

body:[String] The message body
return:[Jabber::Protocol::Message] The current Message object

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

Chaining method...sets the OOB data of the message

data:[String] The message OOB data
return:[Jabber::Protocol::Message] The current Message object

Chaining method...sets the subject of the message

subject:[String] The message subject
return:[Jabber::Protocol::Message] The current Message object

Chaining method...sets the thread of the message

thread:[String] The message thread id
return:[Jabber::Protocol::Message] The current Message object

Chaining method...sets the extended data of the message

x:[String] The message x data
return:[Jabber::Protocol::Message] The current Message object

Chaining method...sets the XHTML body of the message

body:[String] The message body
return:[Jabber::Protocol::Message] The current message object

Generates XML that complies with the Jabber protocol for sending the message through the Jabber service.

return:[String] The XML string.

[Validate]