Mercurial > pidgin
annotate libpurple/plugins/test.pl @ 28006:aa098151ca49
applied changes from c55cc517cc0bc09b677222a63f5f466531033719
through 51ea62d1cdee93a0f6ab96f22d28cbe07ea5d13b
Plucked revision 51ea62d1cdee93a0f6ab96f22d28cbe07ea5d13b from im.pidgin.pidgin.2.6.1
Original commit message:
Make sure configure checks for glib and gtk 2.4.0, since that's what
is needed to compile. We took a small vote on IRC or in the
jabber room and we all thought it would be fine to do this rather
than try to make stuff work. We'll see how it goes.
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 19 Aug 2009 07:39:52 +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 } |
