| 1 | package DJabberd::Delivery::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::Delivery'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 0 | ▶ | sub run_before { ("DJabberd::Delivery::S2S") } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_before: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub deliver { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
deliver: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 0 | my ($self, $vhost, $cb, $stanza) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | my $to = $stanza->to_jid or return $cb->declined; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | my @dconns; | |||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | my $find_bares = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | ▶ | @dconns = grep { $_->is_available || $stanza->deliver_when_unavailable } $vhost->find_conns_of_bare($to) | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$_->is_available || $stanza->deliver_when_unavailable
MC/DC0%0/2
$_->is_available || $stanza->deliver_when_unavailable
$_->is_available
$stanza->deliver_when_unavailable
Truth table0%0/3
A || B
A= $_->is_availableB= $stanza->deliver_when_unavailable
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if ($to->is_bare) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | $find_bares->(); | |||||||||||||||||||||||||||||||||||||||||
| 19 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | my $dest; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if (($dest = $vhost->find_jid($to)) && ($dest->is_available || $stanza->deliver_when_unavailable)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$dest = $vhost->find_jid($to) and $dest->is_available || $stanza->deliver_when_unavailable
$dest->is_available or $stanza->deliver_when_unavailable
MC/DC0%0/3
$dest = $vhost->find_jid($to) and $dest->is_available || $stanza->deliver_when_unavailable
$dest = $vhost->find_jid($to)
$dest->is_available
$stanza->deliver_when_unavailable
Truth table0%0/4
A and B or C
A= $dest = $vhost->find_jid($to)B= $dest->is_availableC= $stanza->deliver_when_unavailable
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | push @dconns, $dest; | |||||||||||||||||||||||||||||||||||||||||
| 23 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | $find_bares->(); | |||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | return $cb->declined unless @dconns; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $DJabberd::Stats::counter{deliver_local}++; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | foreach my $c (@dconns) { | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $c->send_stanza($stanza); | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $cb->delivered; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 20 | 1; | |||||||||||||||||||||||||||||||||||||||||