Jabber::pkt - Perl wrapper for Jabber pkt for management of XML nodes
Jabber::pkt is a helper class - you do not directly invoke it.
Jabber::pkt is a wrapper for the jabberd session manager (sm) packet object. It provides a framework to access characteristics of the packet such as the to and from addresses, the nad object, an dto construct new packets.
Generate an error pkt, based on an existing pkt.
my $epkt = pkt->error($code, $message);
get the packets 'to' address.
my $to = $pkt->to();
get a packets 'from' address.
my $from = $pkt->from();
get a packets 'type' eg. message, presence, or iq.
my $type = $pkt->type();
get a reference to a packets nad object
my $nad = $pkt->nad();
swap a packets to and from address, and return the object for convenience
$pkt = $pkt->tofrom();
Duplicate the packet
my $newpkt = $pkt->dup();
Create a new packet in the context of the current session (session that the current packet is attached to).
my $newpkt = $pkt->create("<message|iq|presence>", $type, $to, $from);
Once the packet skeleton has been created - access the nad ($newpkt->nad) and modify the XML fragment as necessary, before delivering the packet with $newpkt->router().
Send a packet on it's way
Free a packet.
Copy the current packets ID to another packet.
$pkt->id( $otherpkt );