ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-XMPP2/lib/Net/XMPP2/Extendable.pm
Revision: 1.2
Committed: Wed Jul 25 13:53:33 2007 UTC (19 years, 2 months ago) by elmex
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +9 -0 lines
Log Message:
implemented OOB and fixed bugs in Disco and further developed in band registration.

File Contents

# Content
1 package Net::XMPP2::Extendable;
2 use warnings;
3 use strict;
4
5 =head1 NAME
6
7 Net::XMPP2::Extendable - Extendable baseclass
8
9 =head1 DESCRIPTION
10
11 This class provides a mechanism to add extensions.
12 Please note that the class that derives from this must also
13 derive from L<Net::XMPP2::Event>!
14
15 Please see L<Net::XMPP2::Ext> for more information about this mechanism.
16
17 =over 4
18
19 =item B<add_extension ($ext)>
20
21 This method extends the current object with a L<Net::XMPP2::Ext> object.
22 C<$ext> must be an instance of L<Net::XMPP2::Ext>.
23
24 =cut
25
26 sub add_extension {
27 my ($self, $ext) = @_;
28 $self->add_forward ($ext, sub {
29 my ($self, $ext, $ev, @args) = @_;
30 $ext->event ($ev, $self, @args);
31 });
32 }
33
34 =item B<remove_extension ($ext)>
35
36 This method removes the extension C<$ext>.
37
38 =cut
39
40 sub remove_extension {
41 my ($self, $ext) = @_;
42 $self->remove_forward ($ext);
43 }
44
45 =item B<disco_features>
46
47 This method can be overwritten by the extension and should return
48 a list of namespace URIs of the features that the extension enables.
49
50 =cut
51
52 sub disco_features { }
53
54 =back
55
56 =head1 AUTHOR
57
58 Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >>
59
60 =head1 COPYRIGHT & LICENSE
61
62 Copyright 2007 Robin Redeker, all rights reserved.
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
66
67 =cut
68
69 1; # End of Net::XMPP2