Net-Jabber
view release on metacpan or search on metacpan
lib/Net/Jabber/Dialback/Result.pm view on Meta::CPAN
=head2 Retrieval functions
GetTo() - returns a string with server that the <db:result/> is being
sent to.
GetFrom() - returns a string with server that the <db:result/> is being
sent from.
GetType() - returns a string with the type <db:result/> this is.
GetData() - returns a string with the cdata of the <db:result/>.
GetXML() - returns the XML string that represents the <db:result/>.
This is used by the Send() function in Server.pm to send
this object as a Jabber Dialback Result.
GetTree() - returns an array that contains the <db:result/> tag
in XML::Parser::Tree format.
=head2 Creation functions
lib/Net/Jabber/Dialback/Result.pm view on Meta::CPAN
SetTo(string) - sets the to attribute.
SetFrom(string) - sets the from attribute.
SetType(string) - sets the type attribute. Valid settings are:
valid
invalid
SetData(string) - sets the cdata of the <db:result/>.
=head2 Test functions
DefinedTo() - returns 1 if the to attribute is defined in the
<db:result/>, 0 otherwise.
DefinedFrom() - returns 1 if the from attribute is defined in the
<db:result/>, 0 otherwise.
DefinedType() - returns 1 if the type attribute is defined in the
lib/Net/Jabber/Dialback/Verify.pm view on Meta::CPAN
GetTo() - returns a string with server that the <db:verify/> is being
sent to.
GetFrom() - returns a string with server that the <db:verify/> is being
sent from.
GetType() - returns a string with the type <db:verify/> this is.
GetID() - returns a string with the id <db:verify/> this is.
GetData() - returns a string with the cdata of the <db:verify/>.
GetXML() - returns the XML string that represents the <db:verify/>.
This is used by the Send() function in Server.pm to send
this object as a Jabber Dialback Verify.
GetTree() - returns an array that contains the <db:verify/> tag
in XML::Parser::Tree format.
=head2 Creation functions
lib/Net/Jabber/Dialback/Verify.pm view on Meta::CPAN
SetFrom(string) - sets the from attribute.
SetType(string) - sets the type attribute. Valid settings are:
valid
invalid
SetID(string) - sets the id attribute.
SetData(string) - sets the cdata of the <db:verify/>.
=head2 Test functions
DefinedTo() - returns 1 if the to attribute is defined in the
<db:verify/>, 0 otherwise.
DefinedFrom() - returns 1 if the from attribute is defined in the
<db:verify/>, 0 otherwise.
DefinedType() - returns 1 if the type attribute is defined in the
lib/Net/Jabber/Log.pm view on Meta::CPAN
=head2 Retrieval functions
GetFrom() - returns either a string with the Jabber Identifier,
GetFrom("jid") or a Net::Jabber::JID object for the person who
sent the <log/>. To get the JID object set
the string to "jid", otherwise leave blank for the
text string.
GetType() - returns a string with the type <log/> this is.
GetData() - returns a string with the cdata of the <log/>.
GetXML() - returns the XML string that represents the <log/>.
This is used by the Send() function in Client.pm to send
this object as a Jabber Log.
GetTree() - returns an array that contains the <log/> tag
in XML::Parser Tree format.
=head2 Creation functions
lib/Net/Jabber/Log.pm view on Meta::CPAN
(ie. jabber:bob@jabber.org/Silent Bob, etc...)
SetType(string) - sets the type attribute. Valid settings are:
notice general logging
warn warning
alert critical error (can still run but not
correctly)
error fatal error (cannot run anymore)
SetData(string) - sets the cdata of the <log/>.
=head2 Test functions
DefinedFrom() - returns 1 if the from attribute is defined in the
<log/>, 0 otherwise.
DefinedType() - returns 1 if the type attribute is defined in the
<log/>, 0 otherwise.
=head1 AUTHOR
t/parse_x_data.t view on Meta::CPAN
require "t/mytestlib.pl";
my $message_node = new XML::Stream::Node("message");
ok( defined($message_node), "new()" );
isa_ok( $message_node, "XML::Stream::Node" );
$message_node->put_attrib(to=>"jer\@jabber.org",
from=>"reatmon\@jabber.org");
my $body_node = $message_node->add_child("body");
$body_node->add_cdata("body");
my $subject_node = $message_node->add_child("subject");
$subject_node->add_cdata("subject");
my $xdata = $message_node->add_child("x");
$xdata->put_attrib(xmlns=>"jabber:x:data");
$xdata->add_child("instructions","fill this out");
my $field1 = $xdata->add_child("field");
$field1->put_attrib(type=>"hidden",
var=>"formnum");
$field1->add_child("value","value1");
my $field2 = $xdata->add_child("field");
t/parse_x_delay.t view on Meta::CPAN
require "t/mytestlib.pl";
my $message_node = new XML::Stream::Node("message");
ok( defined($message_node), "new()");
isa_ok( $message_node, "XML::Stream::Node" );
$message_node->put_attrib(to=>"jer\@jabber.org",
from=>"reatmon\@jabber.org");
my $body_node = $message_node->add_child("body");
$body_node->add_cdata("body");
my $subject_node = $message_node->add_child("subject");
$subject_node->add_cdata("subject");
my $xdelay1 = $message_node->add_child("x");
$xdelay1->put_attrib(xmlns=>"jabber:x:delay",
from=>"jabber.org",
stamp=>"stamp",
);
$xdelay1->add_cdata("Delay1");
my $xdelay2 = $message_node->add_child("x");
$xdelay2->put_attrib(xmlns=>"jabber:x:delay",
from=>"jabber.org",
stamp=>"stamp",
);
$xdelay2->add_cdata("Delay2");
is( $message_node->GetXML(), "<message from='reatmon\@jabber.org' to='jer\@jabber.org'><body>body</body><subject>subject</subject><x from='jabber.org' stamp='stamp' xmlns='jabber:x:delay'>Delay1</x><x from='jabber.org' stamp='stamp' xmlns='jabber:x:d...
my $message = new Net::Jabber::Message($message_node);
ok( defined($message), "new()" );
isa_ok( $message, "Net::Jabber::Message" );
isa_ok( $message, "Net::XMPP::Message" );
is( $message->GetTo(), "jer\@jabber.org", "GetTo");
is( $message->GetFrom(), "reatmon\@jabber.org", "GetFrom");
( run in 0.310 second using v1.01-cache-2.11-cpan-454fe037f31 )