Class: JSJaCIQ

JSJaCIQ

Models the XMPP notion of an 'iq' packet

new JSJaCIQ

A jabber/XMPP iq packet
Source:
  • JSJaCPacket.js, line 525

Extends

Members

xml

Returns a string representation of the raw xml content of this packet.
Source:
  • JSJaCPacket.js, line 274

Methods

appendNode

Appends node created by buildNode to this packets parent node.
Parameters:
Name Type Description
element Node The node to append or
element string A name plus an object hash with attributes (optional) plus an array of childnodes (optional)
Source:
  • JSJaCPacket.js, line 418
See:
Returns:
This packet
Type
JSJaCPacket

buildNode

Builds a node using script.aculo.us' Dom Builder notation. This code is taken from script.aculo.us' Dom Builder and has been modified to suit our needs.
The original parts of the code do have the following copyright and license notice:
Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.acu lo.us)
script.aculo.us is freely distributable under the terms of an MIT-style licen se. // For details, see the script.aculo.us web site: http://script.aculo.us/
Author:
  • Thomas Fuchs
  • Stefan Strigler
Source:
  • JSJaCPacket.js, line 402
See:
Returns:
The newly created node
Type
Node

clone

Returns a copy of this node
Source:
  • JSJaCPacket.js, line 240
Returns:
a copy of this node
Type
JSJaCPacket

errorReply

Returns an error condition reply according to XEP-0086. Creates a clone of the calling packet with senders and recipient exchanged and error stanza appended.
Parameters:
Name Type Description
stanza_error STANZA_ERROR an error stanza containing error cody, type and condition of the error to be indicated
Source:
  • JSJaCPacket.js, line 257
Returns:
an error reply packet
Type
JSJaCPacket

getChild

Gets a child element of this packet. If no params given returns first child.
Parameters:
Name Type Description
name string Tagname of child to retrieve. Use '*' to match any tag. [optional]
ns string Namespace of child. Use '*' to match any ns.[optional]
Source:
  • JSJaCPacket.js, line 192
See:
Returns:
The child node, null if none found
Type
Node

getChildVal

Gets the node value of a child element of this packet.
Parameters:
Name Type Description
name string Tagname of child to retrieve.
ns string Namespace of child
Source:
  • JSJaCPacket.js, line 224
Returns:
The value of the child node, empty string if none found
Type
string

getDoc

Gets the associated Document for this packet.
Source:
  • JSJaCPacket.js, line 44
See:
Returns:
Type
Document

getFrom

Gets the 'from' attribute of this packet.
Source:
  • JSJaCPacket.js, line 139
Returns:
Type
string

getFromJID

Gets the 'from' attribute of this packet as a JSJaCJID object
Source:
  • JSJaCPacket.js, line 153
Returns:
Type
JSJaCJID

getID

Gets the 'id' of this packet
Source:
  • JSJaCPacket.js, line 160
Returns:
Type
string

getNode

Gets the root node of this packet
Source:
  • JSJaCPacket.js, line 52
See:
Returns:
Type
Node

getQuery

Gets the 'query' node of this packet
Source:
  • JSJaCPacket.js, line 573
See:
Returns:
The query node
Type
Node

getQueryXMLNS

Gets the XMLNS of the query node contained within this packet
Source:
  • JSJaCPacket.js, line 580
Returns:
The namespace of the query node
Type
string

getTo

Gets the 'to' attribute of this packet
Source:
  • JSJaCPacket.js, line 132
Returns:
Type
string

getToJID

Gets the 'to' attribute of this packet as a JSJaCJID object
Source:
  • JSJaCPacket.js, line 146
Returns:
Type
JSJaCJID

getType

Gets the 'type' of this packet
Source:
  • JSJaCPacket.js, line 167
Returns:
Type
string

getXMLLang

Gets the 'xml:lang' of this packet
Source:
  • JSJaCPacket.js, line 174
Returns:
Type
string

getXMLNS

Gets the 'xmlns' (xml namespace) of the root node of this packet
Source:
  • JSJaCPacket.js, line 181
Returns:
Type
string

isError

Checks if packet is of type 'error'
Source:
  • JSJaCPacket.js, line 248
Returns:
'true' if this packet is of type 'error', 'false' otherwise
Type
boolean

pType

Gets the type (name of root element) of this packet, i.e. one of 'presence', 'message' or 'iq'
Source:
  • JSJaCPacket.js, line 37
Returns:
The top level tag name.
Type
string

reply

Creates an IQ reply with type set to 'result'. If given appends payload to first child if IQ. Payload maybe XML as string or a DOM element (or an array of such elements as well).
Parameters:
Name Type Argument Description
payload Element <optional>
An optional payload to be appended.
Source:
  • JSJaCPacket.js, line 593
Returns:
An IQ reply packet
Type
JSJaCIQ

setFrom

Sets the 'from' attribute of the root node of this packet. Usually this is not needed as the server will take care of this automatically.
Parameters:
Name Type Argument Description
from string <optional>
A string representing the jid of the sender of this packet.
Deprecated:
  • Yes
Source:
  • JSJaCPacket.js, line 81
Returns:
this
Type
JSJaCPacket

setID

Sets 'id' attribute of the root node of this packet.
Parameters:
Name Type Description
id string The id of the packet.
Source:
  • JSJaCPacket.js, line 96
Returns:
this
Type
JSJaCPacket

setIQ

Some combined method to set 'to', 'type' and 'id' at once
Parameters:
Name Type Description
to string the recepients JID
type string A XMPP compliant iq type (one of 'set', 'get', 'result' and 'error'
id string A packet ID
Source:
  • JSJaCPacket.js, line 541
Returns:
this
Type
JSJaCIQ

setQuery

Creates a 'query' child node with given XMLNS
Parameters:
Name Type Description
xmlns string The namespace for the 'query' node
Source:
  • JSJaCPacket.js, line 556
See:
Returns:
The query node
Type
Node

setTo

Sets the 'to' attribute of the root node of this packet
Parameters:
Name Type Argument Description
to String <optional>
A string representing a jid sending this packet to. If omitted the property will be deleted thus sending to service rather than dedicated recipient.
Source:
  • JSJaCPacket.js, line 64
Returns:
this
Type
JSJaCPacket

setType

Sets the 'type' attribute of the root node of this packet.
Parameters:
Name Type Description
type string The type of the packet.
Source:
  • JSJaCPacket.js, line 108
Returns:
this
Type
JSJaCPacket

setXMLLang

Sets 'xml:lang' for this packet
Parameters:
Name Type Description
xmllang string The xml:lang of the packet.
Source:
  • JSJaCPacket.js, line 120
Returns:
this
Type
JSJaCPacket