/usr/share/perl5/AnyEvent/XMPP/Extendable.pm is in libanyevent-xmpp-perl 0.55-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | package AnyEvent::XMPP::Extendable;
no warnings;
use strict;
=head1 NAME
AnyEvent::XMPP::Extendable - Extendable baseclass
=head1 DESCRIPTION
This class provides a mechanism to add extensions.
Please note that the class that derives from this must also
derive from L<AnyEvent::XMPP::Event>!
Please see L<AnyEvent::XMPP::Ext> for more information about this mechanism.
=over 4
=item B<add_extension ($ext)>
This method extends the current object with a L<AnyEvent::XMPP::Ext> object.
C<$ext> must be an instance of L<AnyEvent::XMPP::Ext>.
Basically C<add_extension> makes the extension an event receiver
for all events that the extended object receives.
=cut
sub add_extension {
my ($self, $ext) = @_;
$self->add_forward ($ext, sub {
my ($self, $ext, $ev, @args) = @_;
return if $ext->{inhibit_forward}->{$ev};
$ext->_event ($ev, $self, @args);
});
}
=item B<remove_extension ($ext)>
This method removes the extension C<$ext>.
=cut
sub remove_extension {
my ($self, $ext) = @_;
$self->remove_forward ($ext);
}
=back
=head1 AUTHOR
Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >>
=head1 COPYRIGHT & LICENSE
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.
=cut
1; # End of AnyEvent::XMPP
|