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

A class used to build/parse IQ requests/responses

Methods

Constants

ERROR = "error"
GET = "get"
SET = "set"
RESULT = "result"

Attributes

data  [RW] 
error  [RW] 
errorcode  [RW] 
from  [RW] 
id  [RW] 
session  [RW] 
to  [RW] 
type  [RW] 
xmlns  [RW] 

Public Class methods

Factory to build an IQ object from xml element

session:[Jabber::Session] The Jabber session instance
element:[Jabber::Protocol::ParsedXMLElement] The received XML object
return:[Jabber::Protocol::Iq] The newly created Iq object

Generates an IQ Roster Item add request XML element

session:[Session] The session
id:[String] The message id
jid:[JID] The Jabber ID to add to the roster
name:[String] The full name
return:[String] The XML data to send

Generates an IQ authortization request XML element

id:[String] The message id
username:[String] The username
password:[String] The password
resource:[String] The resource to bind this session to
return:[String] The XML data to send

Generates an IQ digest authortization request XML element

id:[String] The message id
username:[String] The username
digest:[String] The SHA-1 hash of the sessionid and the password
resource:[String] The resource to bind this session to
return:[String] The XML data to send

Generates an IQ out of bounds XML element

to:[JID] The Jabber ID to send to
url:[String] The data to send
desc:[String=""] The description of the data
return:[String] The XML data to send

Generates an IQ authortization request XML element

id:[String] The message id
username:[String] The username
password:[String] The password
email:[String] The email address of the account
name:[String] The full name
return:[String] The XML data to send

Generates an IQ roster request XML element

id:[String] The message id
return:[String] The XML data to send

Generates an VCard request XML element

id:[String] The message ID
to:[JID] The jabber id of the account to get the VCard for
return:[String] The XML data to send

Return an IQ object that uses the jabber:iq:private namespace

Default constructor to build an Iq object

session:[Jabber::Session] The Jabber session instance
id:[String=nil] The (optional) id of the Iq object

Public Instance methods

Builds a reply to an existing Iq

return:[Jabber::Protocol::Iq] The result Iq

Sends the IQ to the Jabber service for delivery

wait:[Boolean = false] Wait for reply before return?
&block:[Block] A block to process the message replies

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

return:[String] The XML string.

[Validate]