Mercurial > pidgin
annotate libpurple/plugins/test.pl @ 31568:50ca9e64186b
Only send acks on p2pv2 when required.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 07 May 2011 07:49:25 +0000 |
parents | c9dc220e0301 |
children |
rev | line source |
---|---|
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
1 use Purple; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 %PLUGIN_INFO = ( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 perl_api_version => 2, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 name => 'Test Perl Plugin', |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 version => '1.0', |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 summary => 'Provides as a test base for the perl plugin.', |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 description => 'Provides as a test base for the perl plugin.', |
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
9 author => 'Etan Reisner <deryni\@pidgin.im>', |
16184
22f65e75980c
Point to the Pidgin website.
Richard Laager <rlaager@wiktel.com>
parents:
15373
diff
changeset
|
10 url => 'http://pidgin.im', |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 |
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
12 load => "plugin_load" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 ); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 sub plugin_init { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 return %PLUGIN_INFO; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 |
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
19 sub account_status_cb { |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
20 my ($account, $old, $new, $data) = @_; |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
21 |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
22 Purple::Debug::info("perl test plugin", "In account_status_cb\n"); |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
23 |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
24 Purple::Debug::info("perl test plugin", "Account " . |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
25 $account->get_username() . " changed status.\n"); |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
26 Purple::Debug::info("perl test plugin", $data . "\n"); |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
27 } |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
28 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 sub plugin_load { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 my $plugin = shift; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 |
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
32 Purple::Debug::info("perl test plugin", "plugin_load\n"); |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
33 |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
34 Purple::Debug::info("perl test plugin", "Listing accounts.\n"); |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
35 foreach $account (Purple::Accounts::get_all()) { |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
36 Purple::Debug::info("perl test plugin", $account->get_username() . "\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 |
22521
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
39 Purple::Signal::connect(Purple::Accounts::get_handle(), |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
40 "account-status-changed", $plugin, |
c9dc220e0301
Bring the test.pl plugin at least theoretically up to date (I haven't tried it
Etan Reisner <pidgin@unreliablesource.net>
parents:
22113
diff
changeset
|
41 \&account_status_cb, "test"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 } |