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 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