File Coverage

blib/lib/Mojo/Webqq/Client/Remote/change_state.pm
Criterion Covered Total %
statement 0 11 0.0
branch 0 4 0.0
condition n/a
subroutine 0 1 0.0
pod 0 1 0.0
total 0 17 0.0


line stmt bran cond sub pod time code
1             sub Mojo::Webqq::Client::change_state{
2 0     0 0   my $self = shift;
3 0           my $mode = shift;
4 0           my $api_url = 'http://d1.web2.qq.com/channel/change_status2';
5 0           my $headers = {
6             Referer => 'http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2',
7             json => 1,
8             };
9 0           my @query_string = (
10             newstatus => $mode,
11             clientid => $self->clientid,
12             psessionid => $self->psessionid,
13             t => time,
14             );
15              
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           $self->mode($mode);
20 0           $self->info("登录状态已修改为:$mode");
21 0           return $mode;
22             }
23             1;