Scroll to navigation

AnyEvent::XMPP::Ext::Version(3pm) User Contributed Perl Documentation AnyEvent::XMPP::Ext::Version(3pm)


AnyEvent::XMPP::Ext::Version - Software version


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


This module defines an extension to provide the abilities to answer to software version requests and to request software version from other entities.

See also XEP-0092

This class is derived from AnyEvent::XMPP::Ext and can be added as extension to objects that implement the AnyEvent::XMPP::Extendable interface or derive from it.


Creates a new software version handle.
This method sets the software $name string, the default is "AnyEvent::XMPP".
This method sets the software $version string that is replied.

The default is $AnyEvent::XMPP::VERSION.

This method sets the operating system string $os. If you pass undef the string will be removed.

The default is no operating system string at all.

You may want to pass something like this:

   $version->set_os (`uname -s -r -m -o`);
This method sends a version request to $dest on the connection $con.

$cb is the callback that will be called if either an error occured or the result was received. The callback will also be called after the default IQ timeout for the connection $con. The second argument for the callback will be either undef if no error occured or a AnyEvent::XMPP::Error::IQ error. The first argument will be a hash reference with the following fields:

The JID of the entity this version reply belongs to.
The software version string of the entity.
The software name of the entity.
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     => '',
     name    => 'Exodus',
     version => '',
     os      => 'Windows-XP 5.01.2600',


Robin Redeker, "<elmex at>", JID: "<elmex at>"


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.

2022-12-06 perl v5.36.0