.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "DJabberd::Agent::Node 3" .TH DJabberd::Agent::Node 3 2025-12-14 "perl v5.42.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 DJabberd::Agent::Node \- Abstract class for an agent that handles a specific node .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& package MyPackage::DJabberd::MyNode; \& use base DJabberd::Agent::Node; \& \& # Example of an agent that responds to incoming chat messages \& \& sub handle_message { \& my ($self, $vhost, $stanza) = @_; \& \& my $response = $stanza\->make_response(); \& $response\->set_raw("Hello. I\*(Aqm a software agent."); \& $response\->deliver($vhost); \& } .Ve .PP This class provides a parent class for agents which recieve stanzas addressed to a particular nodename within a domain. .PP Such an agent is often referred to as a "Bot". A higher\-level API for implementing "chat bots" is also provided in DJabberd::Bot. .SH USAGE .IX Header "USAGE" This class is a specialization of DJabberd::Agent. In most cases, users of this class will use the API exposed by DJabberd::Agent. However, there is some special behaviour to note and some additional methods that are not part of the basic agent class. .ie n .SS "handles_destination($self, $to_jid, $vhost)" .el .SS "handles_destination($self, \f(CW$to_jid\fP, \f(CW$vhost\fP)" .IX Subsection "handles_destination($self, $to_jid, $vhost)" This class provides an overriden version of this method which responds with a true value if and only if the domain and the nodename of the destination JID match those that are handled by this instance. .ie n .SS "vcard($self, $requester_jid)" .el .SS "vcard($self, \f(CW$requester_jid\fP)" .IX Subsection "vcard($self, $requester_jid)" The overriden version of this method will return a vCard where the full name is set to the nodename of this instance. Subclasses will probably want to override this to do something more fancy. .SH "SEE ALSO" .IX Header "SEE ALSO" See also DJabberd::Agent, DJabberd::Component. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2007\-2008 Martin Atkins .PP This module is part of the DJabberd distribution and is covered by the distribution\*(Aqs overall licence.