AnyEven...Version(3)
π NAME π
AnyEvent::XMPP::Ext::Version β the software version extension, bestie. It's giving "tell everyone what version of the client you're running" energy β¨
(Oh and btw, this page lives in the User Contributed Perl Documentation section, that's the manual name β and the page itself is AnyEven...Version(3) in the classic truncated style π)
πΈ SYNOPSIS πΈ
use AnyEvent::XMPP::Ext::Version;
my $version = AnyEvent::XMPP::Ext::Version->new;
$version->set_name ("My client");
$version->set_version ("0.3");
$version->set_os (`uname -a`);
$disco->enable_feature ($version->disco_feature);
Look at that. Four lines and you're literally a whole feature π
π¦ DESCRIPTION π¦
So this module defines an extension β and what it does is give you two superpowers π«Ά
- the ability to answer software version requests
- the ability to request software version from other entities
See also XEP-0092 β that's the spec, iykyk π
And here's the family tree moment: this class is derived from AnyEvent::XMPP::Ext, which means you can add it as an extension to objects that implement the AnyEvent::XMPP::Extendable interface β or that derive from it. Slay β¨
π METHODS π
π new (%args)
Creates a new software version handle. Fresh out of the box, main character energy π
π set_name ($name)
This method sets the software $name string.
The default is "AnyEvent::XMPP" β like, the icon it is π
π set_version ($version)
This method sets the software $version string β the one that actually gets replied to people, no cap.
The default is $AnyEvent::XMPP::VERSION. Literally built in π¦
π set_os ($os)
This method sets the operating system string $os.
And bestie, listen β if you pass undef, the string will be removed. Like, gone gone π
The default is no operating system string at all. Nothing. Nada. The void π
You may want to pass something like this:
$version->set_os (`uname -s -r -m -o`);
That's the move, fr fr β
π request_version ($con, $dest, $cb)
This method sends a version request to $dest on the connection $con. Go ask them who they are π
$cb is the callback that will be called if either an error occured or the result was received. And highkey important: the callback will also be called after the default IQ timeout for the connection $con. So yeah, it always comes back to you eventually π«Ά
The second argument for the callback will be either undef if no error occured or a AnyEvent::XMPP::Error::IQ error. So undef = we're so back, error object = it's so over π
The first argument will be a hash reference with the following fields:
jidβ the JID of the entity this version reply belongs to πversionβ the software version string of the entity β¨nameβ the software name of the entity πosβ the operating system of the entity, which might be undefined if none was provided π¦
Here an example of the structure of the hash reference:
{
jid => 'juliet@capulet.com/balcony',
name => 'Exodus',
version => '0.7.0.4',
os => 'Windows-XP 5.01.2600',
}
Juliet on the balcony with Exodus 0.7.0.4 on Windows-XP 5.01.2600 β we love a period-accurate legend ππ₯
π AUTHOR π
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
Shoutout to the author, absolute icon π
π COPYRIGHT & LICENSE π
Copyright 2007, 2008 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Periodt. πΈ
β¨ cute little sign-off β¨ β this masterpiece was brought to you by perl v5.42.2, dated 2026-02-15, and it's the AnyEven...Version(3) page from the User Contributed Perl Documentation corner of the universe π§π bye bestie, go answer some version requests π
π¦ 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