File Coverage

blib/lib/Net/AIM/TOC/Config.pm
Criterion Covered Total %
statement 24 31 77.4
branch 0 4 0.0
condition 0 2 0.0
subroutine 8 9 88.8
pod 0 1 0.0
total 32 47 68.0


line stmt bran cond sub pod time code
1             package Net::AIM::TOC::Config;
2              
3 1     1   5 use strict;
  1         2  
  1         29  
4              
5 1     1   8 use constant DEBUG => 0;
  1         2  
  1         68  
6 1     1   4 use constant REMOVE_HTML_TAGS => 1;
  1         1  
  1         36  
7              
8 1     1   3 use constant AUTH_SERVER => 'login.oscar.aol.com';
  1         2  
  1         38  
9 1     1   4 use constant AUTH_PORT => 5159;
  1         1  
  1         36  
10 1     1   4 use constant TOC_SERVER => 'toc.oscar.aol.com';
  1         2  
  1         115  
11 1     1   5 use constant TOC_PORT => 9898;
  1         1  
  1         52  
12              
13 1     1   5 use constant AGENT => 'Net::AIM::TOC';
  1         2  
  1         174  
14              
15             my $error_lookup = {
16             901 => '%s not currently available',
17             902 => 'Warning of %s not currently available',
18             903 => 'A message has been dropped, you are exceeding the server speed limit',
19             # * Chat Errors *',
20             950 => 'Chat in %s is unavailable.',
21              
22             # * IM & Info Errors *',
23             960 => 'You are sending message too fast to %s',
24             961 => 'You missed an im from %s because it was too big.',
25             962 => 'You missed an im from %s because it was sent too fast.',
26            
27             # * Dir Errors *',
28             970 => 'Failure',
29             971 => 'Too many matches',
30             972 => 'Need more qualifiers',
31             973 => 'Dir service temporarily unavailable',
32             974 => 'Email lookup restricted',
33             975 => 'Keyword Ignored',
34             976 => 'No Keywords',
35             977 => 'Language not supported',
36             978 => 'Country not supported',
37             979 => 'Failure unknown %s',
38            
39             # * Auth errors *',
40             980 => 'Incorrect nickname or password.',
41             981 => 'The service is temporarily unavailable.',
42             982 => 'Your warning level is currently too high to sign on.',
43             983 => 'You have been connecting and disconnecting too frequently. Wait 10 minutes and try again. If you continue to try, you will need to wait even longer.',
44             989 => 'An unknown signon error has occurred %s'
45             };
46              
47              
48             sub EVENT_ERROR_STRING {
49 0     0 0   my $error = shift;
50 0   0       my $extra = shift || undef;
51              
52 0 0         if( defined($error_lookup->{$error}) ) {
53 0 0         if( defined($extra) ) {
54 0           return( sprintf($error_lookup->{$error}, $extra) );
55             }
56             else {
57 0           return( $error_lookup->{$error} );
58             };
59             }
60              
61 0           return( "Event error undefined: $error" );
62             };
63              
64              
65             1;
66