DJabberd/PresenceChecker/Local.pm

filter: Statementstmt 52.6% 10 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 13 / 26 CC 3 SCAR 18.7
CC
3
Cov
48%
check_presence
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« DJabberd/Connection/ServerIn.pm ↑ Summary DJabberd/Roster.pm »
1 package DJabberd::PresenceChecker::Local;
2 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use base 'DJabberd::PresenceChecker';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub check_presence {
Subroutine check_presence: not called CC=3 SCAR=24.8
Pod undocumented
7 0 my ($self, $cb, $jid, $adder) = @_;
8  
9 0 my $vhost = $self->vhost;
10  
11 0 my $map = DJabberd::Presence->local_presence_info($jid);
12 0 foreach my $fullstr (keys %$map) {
13 0 my $jid = DJabberd::JID->new($fullstr);
14  
15 # see if $fullstr is still connected, otherwise ignore.
16 # ideally on disconnect/timeout, the local_presence_info
17 # would be cleaned, but let's not trust that for now.
18 0 ▶ $vhost->find_jid($jid) or next;
Branch: 1 branch
BranchTrueFalseTotal
$vhost->find_jid($jid) or next 0 0 0
19  
20 0 my $pres = $map->{$fullstr};
21 0 $adder->($jid, $pres);
22 }
23  
24 0 $cb->done;
25 }
26  
27 20 1;
« DJabberd/Connection/ServerIn.pm ↑ Summary DJabberd/Roster.pm »