File Coverage

blib/lib/Net/OSCAR/Callbacks/1/incoming_extended_information.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::Callbacks;
2             BEGIN {
3 1     1   27 $Net::OSCAR::Callbacks::VERSION = '1.928';
4             }
5 1     1   8 use strict;
  1         3  
  1         33  
6 1     1   5 use warnings;
  1         2  
  1         37  
7 1     1   5 use vars qw($connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
  1         3  
  1         388  
8             sub {
9              
10             if(exists($data{upload_checksum})) {
11             # OSCAR will send the upload request again on the icon connection.
12             # Since we already have the sending queued up on that connection,
13             # just ignore the repeat request.
14             if($connection->{conntype} != CONNTYPE_ICON) {
15             if($session->{icon} and $session->{is_on}) {
16             $connection->log_print(OSCAR_DBG_INFO, "Uploading buddy icon.");
17             $session->svcdo(CONNTYPE_ICON, protobit => "icon_upload", protodata => {
18             icon => $session->{icon}
19             });
20             }
21             }
22             } elsif(exists($data{resend_checksum})) {
23             $connection->log_print(OSCAR_DBG_INFO, "Got icon resend request!");
24             $session->set_icon($session->{icon}) if $session->{icon};
25             } elsif(exists($data{status_message})) {
26             $session->callback_extended_status($data{status_message});
27             } else {
28             $connection->log_print(OSCAR_DBG_WARN, "Unknown extended info request");
29             }
30              
31             };