File Coverage

blib/lib/Net/OSCAR/ServerCallbacks/4/outgoing_IM.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1             package Net::OSCAR::ServerCallbacks;
2             BEGIN {
3 1     1   20 $Net::OSCAR::ServerCallbacks::VERSION = '1.928';
4             }
5 1     1   5 use strict;
  1         2  
  1         25  
6 1     1   5 use warnings;
  1         3  
  1         29  
7 1     1   4 use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
  1         3  
  1         250  
8             sub {
9              
10             my $target = $SESSIONS->{$data{screenname}};
11             if(!$target or !$target->{sessions}->[0]) {
12             return srv_send_error($connection, $family, 4);
13             }
14              
15             $connection->proto_send(reqid => $reqid, protobit => "IM_acknowledgement", protodata => {
16             cookie => $data{cookie},
17             channel => $data{channel},
18             screenname => $data{screenname}
19             });
20              
21              
22             $data{screenname} = $screenname;
23             $data{evil} = 0;
24             $data{flags} = 0;
25              
26             $target->{sessions}->[0]->proto_send(protobit => "incoming_IM", protodata => {%data});
27              
28             };
29