Mercurial > pidgin
annotate libpurple/plugins/test.pl @ 24865:fbfbebc9197e
Fix two related bugs:
1. When renaming a group and only changing capitalization, Pidgin
prompted you "You are about to merge "Some Group" and "some group"
2. When renaming a group and only changing capitalization, libpurple
got into an infinite loop because the dest and source groups were
the same, and it tried to add buddies to itself until itself was
empty. This resulted in increasing memory and 100% CPU utilization
until the process was killed.
Did we recently change purple_find_group() to be case insensitive or something?
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 22 Dec 2008 22:01:34 +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 } |
