File Coverage

blib/lib/Mojo/Webqq/Message/Remote/_get_sess_sig.pm
Criterion Covered Total %
statement 0 13 0.0
branch 0 8 0.0
condition n/a
subroutine 0 1 0.0
pod n/a
total 0 22 0.0


line stmt bran cond sub pod time code
1             sub Mojo::Webqq::Message::_get_sess_sig {
2 0     0     my $self = shift;
3 0           my($id,$to_uin,$service_type,) = @_;
4 0           my $cache_data = $self->sess_sig_cache->retrieve("$id|$to_uin|$service_type");
5 0 0         return $cache_data if defined $cache_data;
6 0           my $api_url = 'http://d1.web2.qq.com/channel/get_c2cmsg_sig2';
7 0           my @query_string = (
8             id => $id,
9             to_uin => $to_uin,
10             service_type => $service_type,
11             clientid => $self->clientid,
12             psessionid => $self->psessionid,
13             t => time,
14             );
15 0           my $headers = {Referer=>'http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2',json=>1};
16 0           my $json = $self->http_get($self->gen_url($api_url,@query_string),$headers);
17 0 0         return undef unless defined $json;
18 0 0         return undef if $json->{retcode}!=0;
19 0 0         return undef if $json->{result}{value} eq "";
20 0           $self->sess_sig_cache->store("$id|$to_uin|$service_type",$json->{result}{value},300);
21 0           return $json->{result}{value} ;
22             }
23             1;