.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AnyEvent::XMPP::Ext::Version 3" .TH AnyEvent::XMPP::Ext::Version 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME AnyEvent::XMPP::Ext::Version \- Software version .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& 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); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module defines an extension to provide the abilities to answer to software version requests and to request software version from other entities. .PP See also XEP\-0092 .PP 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. .SH METHODS .IX Header "METHODS" .IP "\fBnew (%args)\fR" 4 .IX Item "new (%args)" Creates a new software version handle. .IP "\fBset_name ($name)\fR" 4 .IX Item "set_name ($name)" This method sets the software \f(CW$name\fR string, the default is "AnyEvent::XMPP". .IP "\fBset_version ($version)\fR" 4 .IX Item "set_version ($version)" This method sets the software \f(CW$version\fR string that is replied. .Sp The default is \f(CW$AnyEvent::XMPP::VERSION\fR. .IP "\fBset_os ($os)\fR" 4 .IX Item "set_os ($os)" This method sets the operating system string \f(CW$os\fR. If you pass undef the string will be removed. .Sp The default is no operating system string at all. .Sp You may want to pass something like this: .Sp .Vb 1 \& $version\->set_os (\`uname \-s \-r \-m \-o\`); .Ve .ie n .IP "\fBrequest_version ($con, \fR\fB$dest\fR\fB, \fR\fB$cb\fR\fB)\fR" 4 .el .IP "\fBrequest_version ($con, \fR\f(CB$dest\fR\fB, \fR\f(CB$cb\fR\fB)\fR" 4 .IX Item "request_version ($con, $dest, $cb)" This method sends a version request to \f(CW$dest\fR on the connection \f(CW$con\fR. .Sp \&\f(CW$cb\fR 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 \f(CW$con\fR. 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: .RS 4 .IP jid 4 .IX Item "jid" The JID of the entity this version reply belongs to. .IP version 4 .IX Item "version" The software version string of the entity. .IP name 4 .IX Item "name" The software name of the entity. .IP os 4 .IX Item "os" The operating system of the entity, which might be undefined if none was provided. .RE .RS 4 .Sp Here an example of the structure of the hash reference: .Sp .Vb 6 \& { \& jid => \*(Aqjuliet@capulet.com/balcony\*(Aq, \& name => \*(AqExodus\*(Aq, \& version => \*(Aq0.7.0.4\*(Aq, \& os => \*(AqWindows\-XP 5.01.2600\*(Aq, \& } .Ve .RE .SH AUTHOR .IX Header "AUTHOR" Robin Redeker, \f(CW\*(C`\*(C'\fR, JID: \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007, 2008 Robin Redeker, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.