Mercurial > pidgin
comparison plugins/test.pl @ 6592:b1ea29d1293e
[gaim-migrate @ 7116]
Updated test.pl
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sun, 24 Aug 2003 02:43:42 +0000 |
| parents | e4e87ffd9f14 |
| children |
comparison
equal
deleted
inserted
replaced
| 6591:d25ae4b5a204 | 6592:b1ea29d1293e |
|---|---|
| 1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
| 2 | 2 |
| 3 use Gaim; | 3 use Gaim; |
| 4 use vars qw(%PLUGIN_INFO); | |
| 5 | 4 |
| 6 %PLUGIN_INFO = ( | 5 %PLUGIN_INFO = ( |
| 7 perl_api_version => 2, | 6 perl_api_version => 2, |
| 8 name => 'Test Perl Plugin', | 7 name => 'Test Perl Plugin', |
| 9 version => '1.0', | 8 version => '1.0', |
| 11 description => 'Provides as a test base for the perl plugin.', | 10 description => 'Provides as a test base for the perl plugin.', |
| 12 author => 'Christian Hammond <chipx86@gnupdate.org>', | 11 author => 'Christian Hammond <chipx86@gnupdate.org>', |
| 13 url => 'http://gaim.sf.net/', | 12 url => 'http://gaim.sf.net/', |
| 14 | 13 |
| 15 load => "plugin_load", | 14 load => "plugin_load", |
| 16 unload => "plugin_unload", | 15 unload => "plugin_unload" |
| 17 ); | 16 ); |
| 17 | |
| 18 sub account_away_cb { | |
| 19 Gaim::debug_info("perl test plugin", "In account_away_cb\n"); | |
| 20 | |
| 21 my ($account, $state, $message, $data) = @_; | |
| 22 | |
| 23 Gaim::debug_info("perl test plugin", "Account " . | |
| 24 $account->get_username() . " went away.\n"); | |
| 25 Gaim::debug_info("perl test plugin", $data . "\n"); | |
| 26 } | |
| 18 | 27 |
| 19 sub plugin_init { | 28 sub plugin_init { |
| 20 return %PLUGIN_INFO; | 29 return %PLUGIN_INFO; |
| 21 } | 30 } |
| 22 | 31 |
| 23 sub plugin_load { | 32 sub plugin_load { |
| 33 Gaim::debug_info("perl test plugin", "plugin_load\n"); | |
| 24 my $plugin = shift; | 34 my $plugin = shift; |
| 25 | 35 |
| 36 Gaim::debug_info("perl test plugin", "Listing accounts.\n"); | |
| 26 foreach $account (Gaim::accounts()) { | 37 foreach $account (Gaim::accounts()) { |
| 27 Gaim::debug("perl test plugin", $account->get_username() . "\n"); | 38 Gaim::debug_info("perl test plugin", $account->get_username() . "\n"); |
| 28 } | 39 } |
| 40 | |
| 41 Gaim::debug_info("perl test plugin", "Listing buddy list.\n"); | |
| 42 foreach $group (Gaim::BuddyList::groups()) { | |
| 43 Gaim::debug_info("perl test plugin", | |
| 44 $group->get_name() . ":\n"); | |
| 45 | |
| 46 foreach $buddy ($group->buddies()) { | |
| 47 Gaim::debug_info("perl test plugin", | |
| 48 " " . $buddy->get_name() . "\n"); | |
| 49 } | |
| 50 } | |
| 51 | |
| 52 Gaim::signal_connect(Gaim::Accounts::handle, "account-away", | |
| 53 $plugin, \&account_away_cb, "test"); | |
| 29 } | 54 } |
| 30 | 55 |
| 31 sub plugin_unload { | 56 sub plugin_unload { |
| 32 my $plugin = shift; | 57 my $plugin = shift; |
| 33 } | 58 } |
