barnowl_perlaim
Last change
on this file since 3dcccba was
7a1c90d,
checked in by Geoffrey Thomas <geofft@mit.edu>, 16 years ago
|
Skeleton AIM module, and Net::OSCAR 1.925
|
-
Property mode set to
100644
|
File size:
917 bytes
|
Line | |
---|
1 | package Net::OSCAR::ServerCallbacks; |
---|
2 | use strict; |
---|
3 | use warnings; |
---|
4 | use Net::OSCAR::Common qw(:all); |
---|
5 | use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data); |
---|
6 | sub { |
---|
7 | |
---|
8 | my $cookie = pack("n", $reqid & 0xFFFF) . $data{cookie}; |
---|
9 | if($COOKIES{$cookie}) { |
---|
10 | my $peer = delete $COOKIES{$cookie}; |
---|
11 | my $screenname = $peer->{sn}; |
---|
12 | print "$screenname initiating BOS handshake.\n"; |
---|
13 | $connection->{screenname} = $screenname; |
---|
14 | |
---|
15 | my $sess = $SESSIONS->{$screenname}; |
---|
16 | push @{$sess->{sessions}}, $connection; |
---|
17 | $sess->{extstatus} ||= ""; |
---|
18 | $sess->{away} = 0; |
---|
19 | $sess->{stealth} = 0; |
---|
20 | |
---|
21 | $connection->proto_send(protobit => "server_ready", protodata => { |
---|
22 | families => [grep { !OSCAR_TOOLDATA()->{$_}->{nobos} } keys %{OSCAR_TOOLDATA()}] |
---|
23 | }); |
---|
24 | } else { |
---|
25 | $connection->log_print(OSCAR_DBG_DEBUG, "No cookie: $cookie"); |
---|
26 | $session->delconn($connection); |
---|
27 | } |
---|
28 | |
---|
29 | }; |
---|
30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.