source: perl/modules/AIM/lib/Net/OSCAR/Common.pm @ 3dcccba

barnowl_perlaim
Last change on this file since 3dcccba was 7a1c90d, checked in by Geoffrey Thomas <geofft@mit.edu>, 13 years ago
Skeleton AIM module, and Net::OSCAR 1.925
  • Property mode set to 100644
File size: 5.6 KB
Line 
1=pod
2
3Net::OSCAR::Common -- Net::OSCAR public constants
4
5=cut
6
7package Net::OSCAR::Common;
8
9$VERSION = '1.925';
10$REVISION = '$Revision: 1.67 $';
11
12use strict;
13use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $VERSION);
14use Scalar::Util qw(dualvar);
15require Exporter;
16@ISA = qw(Exporter);
17
18%EXPORT_TAGS = (
19        standard => [qw(
20                ADMIN_TYPE_PASSWORD_CHANGE
21                ADMIN_TYPE_EMAIL_CHANGE
22                ADMIN_TYPE_SCREENNAME_FORMAT
23                ADMIN_TYPE_ACCOUNT_CONFIRM
24                ADMIN_ERROR_UNKNOWN
25                ADMIN_ERROR_DIFFSN
26                ADMIN_ERROR_BADPASS
27                ADMIN_ERROR_BADINPUT
28                ADMIN_ERROR_BADLENGTH
29                ADMIN_ERROR_TRYLATER
30                ADMIN_ERROR_REQPENDING
31                ADMIN_ERROR_CONNREF
32                ADMIN_ERROR_EMAILLIM
33                ADMIN_ERROR_EMAILBAD
34                VISMODE_PERMITALL
35                VISMODE_DENYALL
36                VISMODE_PERMITSOME
37                VISMODE_DENYSOME
38                VISMODE_PERMITBUDS
39                MODBL_ACTION_ADD
40                MODBL_ACTION_DEL
41                MODBL_WHAT_BUDDY
42                MODBL_WHAT_GROUP
43                MODBL_WHAT_PERMIT
44                MODBL_WHAT_DENY
45                TYPINGSTATUS_STARTED
46                TYPINGSTATUS_TYPING
47                TYPINGSTATUS_FINISHED
48                RATE_CLEAR
49                RATE_ALERT
50                RATE_LIMIT
51                RATE_DISCONNECT
52                OSCAR_RATE_MANAGE_NONE
53                OSCAR_RATE_MANAGE_AUTO
54                OSCAR_RATE_MANAGE_MANUAL
55                GROUPPERM_OSCAR
56                GROUPPERM_AOL
57                OSCAR_SVC_AIM
58                OSCAR_SVC_ICQ
59                OSCAR_DIRECT_IM
60                OSCAR_DIRECT_FILESHARE
61                OSCAR_DIRECT_FILEXFER
62                OSCAR_RV_AUTO
63                OSCAR_RV_NOPROXY
64                OSCAR_RV_NODIRECT
65                OSCAR_RV_MANUAL
66        )],
67        loglevels => [qw(
68                OSCAR_DBG_NONE
69                OSCAR_DBG_WARN
70                OSCAR_DBG_INFO
71                OSCAR_DBG_SIGNON
72                OSCAR_DBG_NOTICE
73                OSCAR_DBG_DEBUG
74                OSCAR_DBG_PACKETS
75                OSCAR_DBG_XML
76                OSCAR_DBG_XML2
77        )]
78);
79$EXPORT_TAGS{all} = [@{$EXPORT_TAGS{standard}}, @{$EXPORT_TAGS{loglevels}}];
80@EXPORT_OK = @{$EXPORT_TAGS{all}};
81
82# Log levels
83use constant OSCAR_DBG_NONE => 0;
84use constant OSCAR_DBG_WARN => 1;
85use constant OSCAR_DBG_INFO => 2;
86use constant OSCAR_DBG_SIGNON => 3;
87use constant OSCAR_DBG_NOTICE => 4;
88use constant OSCAR_DBG_DEBUG => 6;
89use constant OSCAR_DBG_PACKETS => 10;
90use constant OSCAR_DBG_XML => 30;
91use constant OSCAR_DBG_XML2 => 35;
92
93# Buddylist modification
94use constant MODBL_ACTION_ADD => dualvar(1, "add");
95use constant MODBL_ACTION_DEL => dualvar(2, "delete");
96use constant MODBL_WHAT_BUDDY => dualvar(1, "buddy");
97use constant MODBL_WHAT_GROUP => dualvar(2, "group");
98use constant MODBL_WHAT_PERMIT => dualvar(3, "permit");
99use constant MODBL_WHAT_DENY => dualvar(4, "deny");
100
101# Typing statuses
102use constant TYPINGSTATUS_STARTED => dualvar(2, "typing started");
103use constant TYPINGSTATUS_TYPING => dualvar(1, "typing in progress");
104use constant TYPINGSTATUS_FINISHED => dualvar(0, "typing completed");
105
106# Administrative functions
107use constant ADMIN_TYPE_PASSWORD_CHANGE => dualvar(1, "password change");
108use constant ADMIN_TYPE_EMAIL_CHANGE => dualvar(2, "email change");
109use constant ADMIN_TYPE_SCREENNAME_FORMAT => dualvar(3, "screenname format");
110use constant ADMIN_TYPE_ACCOUNT_CONFIRM => dualvar(4, "account confirm");
111
112# Adminsitrative responses
113use constant ADMIN_ERROR_UNKNOWN => dualvar(0, "unknown error");
114use constant ADMIN_ERROR_BADPASS => dualvar(1, "incorrect password");
115use constant ADMIN_ERROR_BADINPUT => dualvar(2, "invalid input");
116use constant ADMIN_ERROR_BADLENGTH => dualvar(3, "screenname/email/password is too long or too short");
117use constant ADMIN_ERROR_TRYLATER => dualvar(4, "request could not be processed; wait a few minutes and try again");
118use constant ADMIN_ERROR_REQPENDING => dualvar(5, "request pending");
119use constant ADMIN_ERROR_CONNREF => dualvar(6, "couldn't connect to the admin server");
120use constant ADMIN_ERROR_DIFFSN => dualvar(7, "the new screenname is not equivalent to the old screenname");
121use constant ADMIN_ERROR_EMAILLIM => dualvar(8, "the email address has too many screennames");
122use constant ADMIN_ERROR_EMAILBAD => dualvar(9, "the email address is invalid");
123
124# Direct connect types
125use constant OSCAR_DIRECT_IM => dualvar(1, "direct IM");
126use constant OSCAR_DIRECT_FILESHARE => dualvar(2, "file sharing");
127use constant OSCAR_DIRECT_FILEXFER => dualvar(3, "file transfer");
128
129# Rendezvous autonegotiate modes
130use constant OSCAR_RV_AUTO => "auto";
131use constant OSCAR_RV_NOPROXY => "never proxy";
132use constant OSCAR_RV_NODIRECT => "always proxy";
133use constant OSCAR_RV_MANUAL => "manual negotiation";
134
135
136# Visibility modes
137use constant VISMODE_PERMITALL  => dualvar(0x1, "permit all");
138use constant VISMODE_DENYALL    => dualvar(0x2, "deny all");
139use constant VISMODE_PERMITSOME => dualvar(0x3, "permit some");
140use constant VISMODE_DENYSOME   => dualvar(0x4, "deny some");
141use constant VISMODE_PERMITBUDS => dualvar(0x5, "permit buddies");
142
143# Rate warning types
144use constant RATE_CLEAR => dualvar(1, "clear");
145use constant RATE_ALERT => dualvar(2, "alert");
146use constant RATE_LIMIT => dualvar(3, "limit");
147use constant RATE_DISCONNECT => dualvar(4, "disconnect");
148
149# Rate handling modes
150use constant OSCAR_RATE_MANAGE_NONE => dualvar(0, "none");
151use constant OSCAR_RATE_MANAGE_AUTO => dualvar(1, "auto");
152use constant OSCAR_RATE_MANAGE_MANUAL => dualvar(2, "manual");
153
154# Group permissions
155use constant GROUPPERM_OSCAR => dualvar(0x18, "AOL Instant Messenger users");
156use constant GROUPPERM_AOL => dualvar(0x04, "AOL subscribers");
157
158# Services - deprecated, modules should no longer use these directly
159use constant OSCAR_SVC_AIM => (
160        host => 'login.oscar.aol.com',
161        port => 5190,
162        supermajor => 0x0109,
163        major => 5,
164        minor => 5,
165        subminor => 0,
166        build => 0x0E0B,
167        subbuild => 0x00000104,
168        clistr => "AOL Instant Messenger, version 5.5.3595/WIN32",
169        hashlogin => 0,
170        betainfo => "",
171);
172use constant OSCAR_SVC_ICQ => ( # Courtesy of SDiZ Cheng
173        host => 'login.icq.com',
174        port => 5190,
175        supermajor => 0x010A,
176        major => 5,
177        minor => 0x2D,
178        subminor => 0,
179        build => 0xEC1,
180        subbuild => 0x55,
181        clistr => "ICQ Inc. - Product of ICQ (TM).2003a.5.45.1.3777.85",
182        hashlogin => 1,
183);     
184
1851;
Note: See TracBrowser for help on using the repository browser.