Changeset 770

Show
Ignore:
Timestamp:
09/18/02 11:58:12
Author:
miyagawa
Message:

0.03

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • POE-Component-YahooMessenger/trunk/Changes

    r767 r770  
    11Revision history for Perl extension POE::Component::YahooMessenger 
     2 
     30.03  Wed Sep 18 11:57:33 JST 2002 
     4        - Renamed new_friend_alert to new_buddy_alert 
     5        - Fixed bug in _is_buddy() 
     6        * Added receive_file event (only works when sender is HTTP accessible) 
     7        - Changed buddies API 
     8        * Fixed typo in Constants.pm 
     9          (Thanks to Warren Lindsey <wlindsey@ponvia.com>) 
    210 
    3110.02  Tue Sep 17 12:45:54 JST 2002 
  • POE-Component-YahooMessenger/trunk/lib/POE/Component/YahooMessenger.pm

    r767 r770  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.02
     5$VERSION = 0.03
    66 
    77use POE qw(Wheel::SocketFactory Wheel::ReadWrite Driver::SysRW 
     
    3939            change_status       => \&_handle_common, 
    4040            receive_message     => \&receive_message, 
    41             new_friend_alert  => \&_handle_common, 
     41            new_buddy_alert   => \&_handle_common, 
    4242            toggle_typing       => \&_handle_common, 
    4343            server_is_alive     => \&_handle_common, 
     
    4545            receive_buddy_list  => \&receive_buddy_list, 
    4646            challenge_start     => \&challenge_start, 
     47            receive_file        => \&_handle_common, 
    4748        }, 
    4849        args => [ \%args ], 
     
    180181    while ($buddy_list =~ /([^:]+):([^\x0a]+)\x0a/g) { 
    181182        my $group = $1; 
    182         $heap->{buddies}->{$group} = [ split /,/, $2 ]; 
     183        my @buddies = split /,/, $2; 
     184        $heap->{buddies}->{$_} = $group for @buddies; 
    183185    } 
    184186    $kernel->yield(notify => $event->name, $event); 
     
    219221sub send_message { 
    220222    my($kernel, $heap, $args) = @_[KERNEL, HEAP, ARG0]; 
    221     my $option = _is_buddy($heap, $args->{to}) 
     223    my $option = $heap->{buddies}->{$args->{to}} 
    222224        ? $Options->{to_buddies} : $Options->{to_non_buddies}; 
    223225    $heap->{sock}->put( 
     
    230232        ), 
    231233    ); 
    232 } 
    233  
    234 sub _is_buddy { 
    235     my($heap, $buddy_id) = @_; 
    236     my %buddies = map $_ => 1, map @$_, values %{$heap->{buddies}}; 
    237     return $buddies{$buddy_id}; 
    238234} 
    239235 
     
    301297  sub retrieve_buddies { 
    302298      my $buddies = $_[ARG0]; 
    303       for my $group (keys %$buddies) { 
    304           print "$group:\n", map "  $_\n", @{$buddies->{$group}}; 
     299      for my $buddy_id (keys %$buddies) { 
     300          printf "%s (group: %s)\n", $buddy_id, $buddies->{$buddy_id}; 
    305301      } 
    306302  } 
  • POE-Component-YahooMessenger/trunk/lib/POE/Component/YahooMessenger/Constants.pm

    r767 r770  
    3232    2  => 'goes_offline', 
    3333    3  => 'change_status', 
    34     4  => 'change_status', 
     34    4  => 'change_normal_status', 
    3535    6  => 'receive_message', 
    36     15 => 'new_friend_alert', 
     36    15 => 'new_buddy_alert', 
     37    24 => 'conference_invitation', 
    3738    75 => 'toggle_typing', 
    3839    76 => 'server_is_alive', 
     40    77 => 'receive_file', 
    3941    84 => 'cram_auth_fail', 
    4042    85 => 'receive_buddy_list', 
     
    4749    %$ReceiveEventCodes, 
    4850    6  => 'send_message', 
     51    77 => 'send_file', 
    4952    84 => 'challenge_response', 
    5053}; 
     
    5659    1  => 'id', 
    5760    2  => 'login_nickname', 
    58     3  => 'new_buddy_name', 
     61    3  => 'new_buddy_id', 
    5962    4  => 'from', 
    6063    5  => 'to', 
     
    6972    16 => 'error_message', 
    7073    19 => 'status_message', 
     74    20 => 'download_url', 
     75    27 => 'filename', 
     76    28 => 'filesize', 
    7177    47 => 'busy_code', 
     78    49 => 'command_name',       # XXX 'FILEXFER' 
     79    50 => 'invitation_from', 
     80    52 => 'invitation_with',    # XXX 
     81    53 => 'download_filename', 
     82    54 => 'protocol',           # XXX 'MSG1.0' 
     83    57 => 'conference_name', 
     84    58 => 'invitation_message', 
    7285    87 => 'buddy_list', 
    7386    94 => 'challenge_string', 
  • POE-Component-YahooMessenger/trunk/lib/POE/Filter/YahooMessengerPacket.pm

    r764 r770  
    1414} 
    1515 
    16 use constant DEBUG => 0
     16use constant DEBUG => 1
    1717sub Dumper { require Data::Dumper; Data::Dumper::Dumper(@_) } 
    1818