barnowl_perlaim
Last change
on this file since 7a1c90d 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:
960 bytes
|
Line | |
---|
1 | package Net::OSCAR::Callbacks; |
---|
2 | use strict; |
---|
3 | use warnings; |
---|
4 | use vars qw($connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data); |
---|
5 | sub { |
---|
6 | |
---|
7 | my $conntype; |
---|
8 | my %chatdata; |
---|
9 | |
---|
10 | my $svctype = $data{service_type}; |
---|
11 | |
---|
12 | my $svcmap = tlv(); |
---|
13 | $svcmap->{$_} = $_ foreach (CONNTYPE_LOGIN, CONNTYPE_CHATNAV, CONNTYPE_CHAT, CONNTYPE_ADMIN, CONNTYPE_BOS, CONNTYPE_ICON); |
---|
14 | $conntype = $svcmap->{$svctype} || sprintf("unknown (0x%04X)", $svctype); |
---|
15 | if($svctype == CONNTYPE_CHAT) { |
---|
16 | %chatdata = %{$session->{chats}->{$reqid}}; |
---|
17 | $conntype = "chat $chatdata{name}"; |
---|
18 | } |
---|
19 | |
---|
20 | $connection->log_print(OSCAR_DBG_NOTICE, "Got redirect for $svctype."); |
---|
21 | |
---|
22 | my $newconn = $session->addconn(auth => $data{auth_cookie}, conntype => $svctype, description => $conntype, peer => $data{server_ip}); |
---|
23 | if($svctype == CONNTYPE_CHAT) { |
---|
24 | $session->{chats}->{$reqid} = $newconn; |
---|
25 | my($key, $val); |
---|
26 | while(($key, $val) = each(%chatdata)) { $session->{chats}->{$reqid}->{$key} = $val; } |
---|
27 | } |
---|
28 | |
---|
29 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.