AnyEven...xt::OOB(3)
β¨ NAME β¨
okay so welcome to the AnyEven...xt::OOB(3) page, bestie π this is the User Contributed Perl Documentation situation for AnyEvent::XMPP::Ext::OOB β literally XEP-0066 Out of Band Data. iconic.
π¦ SYNOPSIS π¦
bestie, hereβs the whole vibe in code β copy it exactly, no cap:
my $con = AnyEvent::XMPP::Connection->new (...);
$con->add_extension (my $disco = AnyEvent::XMPP::Ext::Disco->new);
$con->add_extension (my $oob = AnyEvent::XMPP::Ext::OOB->new);
$disco->enable_feature ($oob->disco_feature);
$oob->reg_cb (oob_recv => sub {
my ($oob, $con, $node, $url) = @_;
if (got ($url)) {
$oob->reply_success ($con, $node);
} else {
$oob->reply_failure ($con, $node, 'not-found');
}
});
$oob->send_url (
$con, 'someonewho@wants.an.url.com', "http://nakedgirls.com/marie_021.jpg",
"Yaww!!! Hot like SUN!",
sub {
my ($error) = @_;
if ($error) { # then error
} else { # everything fine
}
}
)
π DESCRIPTION π
okay so this module gives you a helper abstraction for handling out of band data as specified in XEP-0066. π«Ά
The object that is generated handles out of band data requests to and from others.
There is are also some utility function defined to get for example the oob info from an XML element β yes, βis areβ, weβre keeping the chaotic energy π:
π FUNCTIONS π
url_from_node ($node)
This function extracts the URL and optionally a description field from the XML element in $node (which must be a AnyEvent::XMPP::Node). β¨
$node must be the XML node which contains the <url> and optionally <desc> element (which is eg. a <x xmlns='jabber:x:oob'> element)! π₯
(This method searches both, the jabber:x:oob and jabber:iq:oob namespaces for the <url> and <desc> elements).
It returns a hash reference which should have following structure:
{
url => "http://someurl.org/mycoolparty.jpg",
desc => "That was a party!",
}
If nothing was found this method returns nothing (undef).
π METHODS π
new ()
This is the constructor, it takes no further arguments. periodt. π
reply_success ($con, $node)
This method replies to the sender of the oob that the URL was retrieved successfully. πΈ
$con and $node are the $con and $node arguments of the "oob_recv" event you want to reply to.
reply_failure ($con, $node, $type)
This method replies to the sender that either the transfer was rejected or it was not fount. π yes, βfountβ β the typo is part of the lore now.
If the transfer was rejectes you have to set $type to 'reject', otherwise $type must be 'not-found'.
$con and $node are the $con and $node arguments of the "oob_recv" event you want to reply to.
send_url ($con, $jid, $url, $desc, $cb)
This method sends a out of band file transfer request to $jid. $url is the URL that the otherone has to download. $desc is an optional description string (human readable) for the file pointed at by the url and can be undef when you donβt want to transmit any description. π«Ά
$cb is a callback that will be called once the transfer is successful.
The first argument to the callback will either be undef in case of success or 'reject' when the other side rejected the file or 'not-found' if the other side was unable to download the file.
π EVENTS π
These events can be registered to whith "reg_cb" β again, βwhithβ is the original spelling and weβre not fixing it π
:
oob_recv => $con, $node, $url
This event is generated whenever someone wants to send you a out of band data file. $url is a hash reference like itβs returned by "url_from_node". β¨
$con is the AnyEvent::XMPP::Connection (Or AnyEvent::XMPP::IM::Connection) the data was received from.
$node is the AnyEvent::XMPP::Node of the IQ request, you can get the senders JID from the 'from' attribute of it.
If you fetched the file successfully you have to call "reply_success". If you want to reject the file or couldnβt get it call "reply_failure".
mwah π thatβs the whole AnyEven...xt::OOB(3) page, bestie. itβs giving User Contributed Perl Documentation, and it comes from perl v5.42.2, dated 2026-02-15. slay and stay hydrated π«Άβ¨
π¦ where this page comes from
- alpine 3.24: perl-anyevent-xmpp-doc 0.55-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms