blib/lib/Net/OSCAR/Connection/Chat.pm

filter: Statementstmt 65.9% 31 / 47 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 62.5% 10 / 16 Podpod 0.0% 0 / 6 totaltotal 53.9% 41 / 76 CC 4 SCAR 12.5
CC
4
Cov
58%
chat_send
12.0
invite
6.0
part
2.0
CRAP 3.5
« blib/lib/Net/OSCAR/Callbacks/19/buddylist_modify.pm ↑ Summary blib/lib/Net/OSCAR/ServerCallbacks/19/buddylist_request.pm »
1 =pod
2  
3 Net::OSCAR::Connection::Chat -- OSCAR chat connections
4  
5 =cut
6  
7 package Net::OSCAR::Connection::Chat;
8 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 $Net::OSCAR::Connection::Chat::VERSION = '1.928';
10 }
11  
12 1 $REVISION = '$Revision$';
13  
14 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use Net::OSCAR::TLV;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use Net::OSCAR::Callbacks;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Net::OSCAR::Common qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Net::OSCAR::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Net::OSCAR::Utility;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Net::OSCAR::XML;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 @ISA = qw(Net::OSCAR::Connection);
25  
26 0 ▶sub invite($$;$) {
Subroutine invite: not called CC=2 SCAR=17.9
Pod undocumented
27 0 my($self, $who, $message) = @_;
28 0 ▶ $message ||= "Join me in this Buddy Chat";
Condition0%0/2
$message ||= "Join me in this Buddy Chat"
l!l
00
MC/DC0%0/1
$message ||= "Join me in this Buddy Chat"
$message
Truth table0%0/2
A
A= $message
Aresult
11
00
29  
30 0 $self->log_print(OSCAR_DBG_DEBUG, "Inviting $who to join us.");
31  
32 my $svcdata = protoparse($self, "chat_invite_rendezvous_data")->pack(
33 exchange => $self->{exchange},
34 url => $self->{url}
35 0 );
36  
37 0 my $cookie = randchars(8);
38 my %rvdata = (
39 capability => OSCAR_CAPS()->{chat}->{value},
40 0 charset => "us-ascii",
41 cookie => $cookie,
42 invitation_msg => $message,
43 push_pull => 1,
44 status => "propose",
45 svcdata => $svcdata
46 );
47  
48 0 return $self->{session}->send_message($who, 2, protoparse($self, "rendezvous_IM")->pack(%rvdata), 0, $cookie);
49 }
50  
51 0 ▶sub chat_send($$;$$) {
Subroutine chat_send: not called CC=3 SCAR=24.8
Pod undocumented
52 0 my($self, $msg, $noreflect, $away) = @_;
53  
54 0 my %protodata = (
55 cookie => randchars(8),
56 message => $msg
57 );
58 0 ▶ $protodata{reflect} = "" unless $noreflect;
Branch: 1 branch
BranchTrueFalseTotal
unless $noreflect 0 0 0
59 0 ▶ $protodata{is_automatic} = "" if $away;
Branch: 1 branch
BranchTrueFalseTotal
if $away 0 0 0
60  
61 0 $self->proto_send(protobit => "outgoing_chat_IM", protodata => \%protodata);
62 }
63  
64 0 ▶sub part($) { shift->disconnect(); }
Subroutine part: not called CC=1 SCAR=6.9
Pod undocumented
65 0 ▶sub url($) { shift->{url}; }
Subroutine url: not called CC=1 SCAR=6.9
Pod undocumented
66 0 ▶sub name($) { shift->{name}; }
Subroutine name: not called CC=1 SCAR=6.9
Pod undocumented
67 0 ▶sub exchange($) { shift->{exchange}; }
Subroutine exchange: not called CC=1 SCAR=6.9
Pod undocumented
68  
69 1 1;
« blib/lib/Net/OSCAR/Callbacks/19/buddylist_modify.pm ↑ Summary blib/lib/Net/OSCAR/ServerCallbacks/19/buddylist_request.pm »