line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=pod |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Net::OSCAR::Connection::Chat -- OSCAR chat connections |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=cut |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Net::OSCAR::Connection::Chat; |
8
|
|
|
|
|
|
|
BEGIN { |
9
|
1
|
|
|
1
|
|
998
|
$Net::OSCAR::Connection::Chat::VERSION = '1.928'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$REVISION = '$Revision$'; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
15
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
61
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
6
|
use Net::OSCAR::TLV; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
18
|
1
|
|
|
1
|
|
5
|
use Net::OSCAR::Callbacks; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
19
|
1
|
|
|
1
|
|
4
|
use vars qw(@ISA); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
20
|
1
|
|
|
1
|
|
5
|
use Net::OSCAR::Common qw(:all); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
323
|
|
21
|
1
|
|
|
1
|
|
6
|
use Net::OSCAR::Constants; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
113
|
|
22
|
1
|
|
|
1
|
|
5
|
use Net::OSCAR::Utility; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
102
|
|
23
|
1
|
|
|
1
|
|
4
|
use Net::OSCAR::XML; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
407
|
|
24
|
|
|
|
|
|
|
@ISA = qw(Net::OSCAR::Connection); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub invite($$;$) { |
27
|
0
|
|
|
0
|
0
|
|
my($self, $who, $message) = @_; |
28
|
0
|
|
0
|
|
|
|
$message ||= "Join me in this Buddy Chat"; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->log_print(OSCAR_DBG_DEBUG, "Inviting $who to join us."); |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $svcdata = protoparse($self, "chat_invite_rendezvous_data")->pack( |
33
|
|
|
|
|
|
|
exchange => $self->{exchange}, |
34
|
|
|
|
|
|
|
url => $self->{url} |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $cookie = randchars(8); |
38
|
0
|
|
|
|
|
|
my %rvdata = ( |
39
|
|
|
|
|
|
|
capability => OSCAR_CAPS()->{chat}->{value}, |
40
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
sub chat_send($$;$$) { |
52
|
0
|
|
|
0
|
0
|
|
my($self, $msg, $noreflect, $away) = @_; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my %protodata = ( |
55
|
|
|
|
|
|
|
cookie => randchars(8), |
56
|
|
|
|
|
|
|
message => $msg |
57
|
|
|
|
|
|
|
); |
58
|
0
|
0
|
|
|
|
|
$protodata{reflect} = "" unless $noreflect; |
59
|
0
|
0
|
|
|
|
|
$protodata{is_automatic} = "" if $away; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
$self->proto_send(protobit => "outgoing_chat_IM", protodata => \%protodata); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
0
|
|
sub part($) { shift->disconnect(); } |
65
|
0
|
|
|
0
|
0
|
|
sub url($) { shift->{url}; } |
66
|
0
|
|
|
0
|
0
|
|
sub name($) { shift->{name}; } |
67
|
0
|
|
|
0
|
0
|
|
sub exchange($) { shift->{exchange}; } |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |