line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=pod |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::OSCAR::Callbacks -- Process responses from OSCAR server |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
version 1.928 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Net::OSCAR::Callbacks; |
14
|
|
|
|
|
|
|
BEGIN { |
15
|
4
|
|
|
4
|
|
126
|
$Net::OSCAR::Callbacks::VERSION = '1.928'; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$REVISION = '$Revision$'; |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
139
|
|
21
|
4
|
|
|
4
|
|
20
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
263
|
|
22
|
|
|
|
|
|
|
|
23
|
4
|
|
|
4
|
|
21
|
use Net::OSCAR::Common qw(:all); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1723
|
|
24
|
4
|
|
|
4
|
|
26
|
use Net::OSCAR::Constants; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
441
|
|
25
|
4
|
|
|
4
|
|
21
|
use Net::OSCAR::Utility; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
475
|
|
26
|
4
|
|
|
4
|
|
21
|
use Net::OSCAR::TLV; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
175
|
|
27
|
4
|
|
|
4
|
|
2171
|
use Net::OSCAR::Buddylist; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
120
|
|
28
|
4
|
|
|
4
|
|
2301
|
use Net::OSCAR::_BLInternal; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
252
|
|
29
|
4
|
|
|
4
|
|
40
|
use Net::OSCAR::XML; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
2911
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our %protohandlers; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub process_snac($$) { |
34
|
0
|
|
|
0
|
0
|
|
our($connection, $snac) = @_; |
35
|
0
|
|
|
|
|
|
our($conntype, $family, $subtype, $data, $reqid) = ($connection->{conntype}, $snac->{family}, $snac->{subtype}, $snac->{data}, $snac->{reqid}); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
our $reqdata = delete $connection->{reqdata}->[$family]->{pack("N", $reqid)}; |
38
|
0
|
|
|
|
|
|
our $session = $connection->{session}; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $protobit = snac_to_protobit(%$snac); |
41
|
0
|
0
|
|
|
|
|
if(!$protobit) { |
42
|
0
|
|
|
|
|
|
return $session->callback_snac_unknown($connection, $snac, $data); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
0
|
|
|
|
our %data = protoparse($session, $protobit)->unpack($data || ""); |
46
|
0
|
|
|
|
|
|
$connection->log_printf(OSCAR_DBG_DEBUG, "Got SNAC 0x%04X/0x%04X: %s", $snac->{family}, $snac->{subtype}, $protobit); |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if(!exists($protohandlers{$protobit})) { |
49
|
0
|
|
|
|
|
|
$protohandlers{$protobit} = eval { |
50
|
0
|
|
|
|
|
|
require "Net/OSCAR/Callbacks/$family/$protobit.pm"; |
51
|
|
|
|
|
|
|
}; |
52
|
0
|
0
|
|
|
|
|
if($@) { |
53
|
0
|
|
|
|
|
|
my $olderr = $@; |
54
|
0
|
|
|
|
|
|
$protohandlers{$protobit} = eval { |
55
|
0
|
|
|
|
|
|
require "Net/OSCAR/Callbacks/0/$protobit.pm"; |
56
|
|
|
|
|
|
|
}; |
57
|
0
|
0
|
|
|
|
|
if($@) { |
58
|
0
|
|
|
0
|
|
|
$protohandlers{$protobit} = sub {}; |
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
$protohandlers{$protobit}->(); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return 1; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub got_buddylist($$) { |
68
|
0
|
|
|
0
|
0
|
|
my($session, $connection) = @_; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$connection->proto_send(protobit => "add_IM_parameters"); |
71
|
0
|
|
|
|
|
|
$connection->ready(); |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
|
$session->set_extended_status("") if $session->{capabilities}->{extended_status}; |
74
|
0
|
|
|
|
|
|
$connection->proto_send(protobit => "set_idle", protodata => {duration => 0}); |
75
|
0
|
|
|
|
|
|
$connection->proto_send(protobit => "buddylist_done"); |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
$session->{is_on} = 1; |
78
|
0
|
0
|
|
|
|
|
$session->callback_signon_done() unless $session->{sent_done}++; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub default_snac_unknown($$$$) { |
82
|
0
|
|
|
0
|
0
|
|
my($session, $connection, $snac, $data) = @_; |
83
|
0
|
|
|
0
|
|
|
$session->log_printf_cond(OSCAR_DBG_WARN, sub { "Unknown SNAC %d/%d: %s", $snac->{family},$snac->{subtype}, hexdump($snac->{data}) }); |
|
0
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |