| 1 | package DJabberd::Plugin; | ||||||||||
| 2 | 20 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 20 | ▶ | use DJabberd::Log; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 20 | our $logger = DJabberd::Log->get_logger(); | |||||||||
| 5 | |||||||||||
| 6 | 210 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 7 | 210 | my ($class, @config) = @_; | |||||||||
| 8 | 210 | my $self = bless {}, $class; | |||||||||
| 9 | |||||||||||
| 10 | 210 | ▶ | if (@config) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 82 | ▶ | while (my ($k, $v) = splice(@config, 0, 2)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 123 | my $meth = "set_config_$k"; | |||||||||
| 13 | 123 | $self->$meth($v); | |||||||||
| 14 | } | ||||||||||
| 15 | 82 | $self->finalize; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 210 | return $self; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | # called when </Plugin> line is parsed. you can die here if the object hasn't | ||||||||||
| 22 | # been setup properly | ||||||||||
| 23 | 41 | ▶ | sub finalize { | ||||||||
|
Subroutine
finalize: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | # list of classnames you want to run before/after (in your phase only) | ||||||||||
| 27 | 0 | ▶ | sub run_after { | ||||||||
|
Subroutine
run_after: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | return () | ||||||||||
| 29 | 0 | } | |||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub run_before { | ||||||||
|
Subroutine
run_before: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | return () | ||||||||||
| 33 | 0 | } | |||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub register { | ||||||||
|
Subroutine
register: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my ($self, $server) = @_; | |||||||||
| 37 | 0 | $logger->warn("[not implemented] $self should register for $server"); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 20 | 1; | |||||||||