Changeset 403198c for perl/modules/AIM
- Timestamp:
- Jun 1, 2008, 8:37:02 PM (16 years ago)
- Branches:
- barnowl_perlaim
- Children:
- 7d63a6c
- Parents:
- 5fcf137
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/AIM/lib/BarnOwl/Module/AIM.pm
r5fcf137 r403198c 16 16 use Net::OSCAR; 17 17 18 sub cmd_aimlogin { 19 my ($cmd, $user, $pass) = @_; 20 if (undef $user) { 21 BarnOwl::start_question('Username: ', sub { 22 cmd_aimlogin($cmd, @_); 23 }); 24 } elsif (undef $pass) { 25 BarnOwl::start_password('Password: ', sub { 26 cmd_aimlogin($cmd, $user, @_); 27 }); 28 } else { 29 my $oscar = Net::OSCAR->new(); 30 $oscar->set_callback_im_in(\&on_im_in); 31 $oscar->signon($user, $pass); 32 } 33 } 18 our @oscars; 34 19 35 20 sub on_im_in { … … 44 29 } 45 30 31 sub cmd_aimlogin { 32 =comment 33 my ($cmd, $user, $pass) = @_; 34 if (!defined $user) { 35 BarnOwl::start_question('Username: ', sub { 36 cmd_aimlogin($cmd, @_); 37 }); 38 } elsif (!defined $pass) { 39 BarnOwl::start_password('Password: ', sub { 40 cmd_aimlogin($cmd, $user, @_); 41 }); 42 } else { 43 =cut 44 { 45 my $oscar = Net::OSCAR->new(); 46 my ($user, $pass) = ('...', '...'); 47 $oscar->set_callback_im_in(\&on_im_in); 48 $oscar->signon( 49 screenname => $user, 50 password => $pass 51 ); 52 push @oscars, $oscar; 53 } 54 } 46 55 BarnOwl::new_command(aimlogin => \&cmd_aimlogin, {}); 47 56 57 sub main_loop { 58 for my $oscar (@oscars) { 59 $oscar->do_one_loop(); 60 } 61 } 62 $BarnOwl::Hooks::mainLoop->add(\&main_loop); 63 48 64 1; 65 66 # vim: set sw=4 et cin:
Note: See TracChangeset
for help on using the changeset viewer.