Weixin/Message/Remote/_revoke_message.pm

filter: Statementstmt 22.2% 4 / 18 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod n/a totaltotal 18.5% 5 / 27 CC 4 SCAR 26.3
CC
4
Cov
17%
_revoke_message
20.0
__ANON__
2.0
BEGIN
1.0
CRAP 13.8
« Weixin/Plugin/UploadQRcode2.pm ↑ Summary Weixin/Base.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 0 ▶sub Mojo::Weixin::_revoke_message {
Subroutine _revoke_message: not called CC=4 SCAR=30.0
3 0 my $self = shift;
4 0 my ($msg_id,$receiver_id) = @_;
5 0 my $api = "https://".$self->domain . "/cgi-bin/mmwebwx-bin/webwxrevokemsg";
6 0 my @query_string =();
7 0 ▶ push @query_string,(pass_ticket => $self->url_escape($self->pass_ticket)) if $self->pass_ticket;
Branch: 1 branch
BranchTrueFalseTotal
if $self->pass_ticket 0 0 0
8 my $post = {
9 BaseRequest => {
10 DeviceID => $self->deviceid,
11 Sid => $self->wxsid,
12 Skey => $self->skey,
13 Uin => $self->wxuin,
14 },
15 0 ▶ ClientMsgId => sub{my $r = sprintf "%.3f", rand();$r=~s/\.//g;my $t = $self->now() . $r;$t;}->(),
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 SvrMsgId => $msg_id,
17 ToUserName => $receiver_id,
18 };
19  
20 0 my $json = $self->http_post($self->gen_url($api,@query_string),{blocking=>1,Referer=>'https://' . $self->domain . '/',json=>1},json=>$post);
21 0 ▶ return if not defined $json;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $json 0 0 0
22 0 ▶ return if $json->{BaseResponse}{Ret} !=0;
Branch: 1 branch
BranchTrueFalseTotal
if $json->{"BaseResponse"}{"Ret"} != 0 0 0 0
23 0 return 1;
24 }
25  
26 1 1;
« Weixin/Plugin/UploadQRcode2.pm ↑ Summary Weixin/Base.pm »