pidgin: f1495845: Bring the test.pl plugin at least theore...

deryni at pidgin.im deryni at pidgin.im
Wed Mar 19 23:45:49 EDT 2008


-----------------------------------------------------------------
Revision: f14958459e9f62fd8c988e1317019c10a0fddf06
Ancestor: 996146840a5cce76f0a4aedef7537793d3783ef5
Author: deryni at pidgin.im
Date: 2008-02-27T22:51:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f14958459e9f62fd8c988e1317019c10a0fddf06

Modified files:
        libpurple/plugins/test.pl

ChangeLog: 

Bring the test.pl plugin at least theoretically up to date (I haven't tried it
but at least it doesn't refer to Gaim anymore).

-------------- next part --------------
============================================================
--- libpurple/plugins/test.pl	538be7ec7e701003f7227f38fb97ecbb407f2e15
+++ libpurple/plugins/test.pl	fb64a825d58f19b6b8728558505742c543f1b0c6
@@ -1,58 +1,42 @@
-#!/usr/bin/env perl -w
+use Purple;
 
-use Gaim;
-
 %PLUGIN_INFO = (
 	perl_api_version => 2,
 	name             => 'Test Perl Plugin',
 	version          => '1.0',
 	summary          => 'Provides as a test base for the perl plugin.',
 	description      => 'Provides as a test base for the perl plugin.',
-	author           => 'Christian Hammond <chipx86 at gnupdate.org>',
+	author           => 'Etan Reisner <deryni\@pidgin.im>',
 	url              => 'http://pidgin.im',
 
-	load             => "plugin_load",
-	unload           => "plugin_unload"
+	load             => "plugin_load"
 );
 
-sub account_away_cb {
-	Gaim::debug_info("perl test plugin", "In account_away_cb\n");
+sub plugin_init {
+	return %PLUGIN_INFO;
+}
 
-	my ($account, $state, $message, $data) = @_;
+sub account_status_cb {
+	my ($account, $old, $new, $data) = @_;
 
-	Gaim::debug_info("perl test plugin", "Account " .
-	                 $account->get_username() . " went away.\n");
-	Gaim::debug_info("perl test plugin", $data . "\n");
-}
+	Purple::Debug::info("perl test plugin", "In account_status_cb\n");
 
-sub plugin_init {
-	return %PLUGIN_INFO;
+	Purple::Debug::info("perl test plugin", "Account " .
+	                    $account->get_username() . " changed status.\n");
+	Purple::Debug::info("perl test plugin", $data . "\n");
 }
 
 sub plugin_load {
-	Gaim::debug_info("perl test plugin", "plugin_load\n");
 	my $plugin = shift;
 
-	Gaim::debug_info("perl test plugin", "Listing accounts.\n");
-	foreach $account (Gaim::accounts()) {
-		Gaim::debug_info("perl test plugin", $account->get_username() . "\n");
-	}
+	Purple::Debug::info("perl test plugin", "plugin_load\n");
 
-	Gaim::debug_info("perl test plugin", "Listing buddy list.\n");
-	foreach $group (Gaim::BuddyList::groups()) {
-		Gaim::debug_info("perl test plugin",
-		                 $group->get_name() . ":\n");
-
-		foreach $buddy ($group->buddies()) {
-			Gaim::debug_info("perl test plugin",
-			                 "  " . $buddy->get_name() . "\n");
-		}
+	Purple::Debug::info("perl test plugin", "Listing accounts.\n");
+	foreach $account (Purple::Accounts::get_all()) {
+		Purple::Debug::info("perl test plugin", $account->get_username() . "\n");
 	}
 
-	Gaim::signal_connect(Gaim::Accounts::handle, "account-away",
-	                     $plugin, \&account_away_cb, "test");
+	Purple::Signal::connect(Purple::Accounts::get_handle(),
+	                        "account-status-changed", $plugin,
+	                        \&account_status_cb, "test");
 }
-
-sub plugin_unload {
-	my $plugin = shift;
-}


More information about the Commits mailing list