root/POE-Component-YahooMessenger/trunk/lib/POE/Component/YahooMessenger/Constants.pm

Revision 764 (checked in by miyagawa, 18 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 package POE::Component::YahooMessenger::Constants;
2 use strict;
3
4 BEGIN {
5     use vars qw(@EXPORT @ISA);
6
7     require Exporter;
8     @ISA    = qw(Exporter);
9     @EXPORT = qw($MessageHeader $BodySeparater
10                  $ReceiveEventCodes $ReceiveEventNames
11                  $SendEventCodes $SendEventNames
12                  $BodyCodes $BodyNames $Default);
13 }
14
15 use vars @EXPORT;
16
17 $Default = {
18     hostanme      => 'scs.yahoo.com',
19     port          => 5050,
20 };
21
22 $MessageHeader = 'YMSG';
23 $BodySeparater = "\xC0\x80";
24
25 $ReceiveEventCodes = {
26     1  => 'goes_online',
27     2  => 'goes_offline',
28     3  => 'change_status',
29     4  => 'change_status',
30     6  => 'receive_message',
31     15 => 'new_friend_alert',
32     75 => 'toggle_typing',
33     76 => 'server_is_alive',
34     84 => 'cram_auth_fail',
35     85 => 'receive_buddy_list',
36     87 => 'challenge_start',
37 };
38
39 $ReceiveEventNames = { reverse %$ReceiveEventCodes };
40
41 $SendEventCodes = {
42     %$ReceiveEventCodes,
43     6  => 'send_message',
44     84 => 'challenge_response',
45 };
46
47 $SendEventNames = { reverse %$SendEventCodes };
48
49 $BodyCodes = {
50     0  => 'my_id',
51     1  => 'id',
52     2  => 'login_nickname',
53     3  => 'new_buddy_name',
54     4  => 'from',
55     5  => 'to',
56     6  => 'crypt_salt',
57     7  => 'buddy_id',
58     8  => 'number_of_online_buddies',
59     10 => 'status_code',
60     11 => 'session_id',
61     13 => 'live',
62     14 => 'message',
63     15 => 'received_time',
64     16 => 'error_message',
65     19 => 'status_message',
66     47 => 'busy_code',
67     87 => 'buddy_list',
68     94 => 'challenge_string',
69     96 => 'crypted_response',
70 };
71
72 $BodyNames = { reverse %$BodyCodes };
73
74 1;
Note: See TracBrowser for help on using the browser.