Mercurial > pidgin
annotate plugins/perl/scripts/account.pl @ 12024:e67993da8a22
[gaim-migrate @ 14317]
I strongly suspect CruiseControl is going to yell at me for this.
A voice chat API, GUI + mediastreamer. This is what I'm using for Google Talk.
This doesn't actually do anything at all. There's no code in the Jabber plugin yet
to use this API (although it Works For Me). All it will do is compile and link.
If you're lucky.
To build this, you should install oRTP from Linphone, Speex and iLBC (also
from linphone, I believe). To not build this, ./configure --disable-vv.
Most of the configure.ac and Makefile.am hackery was lifted right out of
Linphone with a few modifications. It seems to work if you have everything
installed or if you --disable-vv. I haven't really tested not having
everything installed and not --disabling-vv.
It's kinda funky to include all of mediastreamer in the source tree like this,
but linphone doesn't build it as a separate library. I'll probably wind up
writing them a patch to build it as a .so so we can link it dynamically instead.
This code certainly isn't finished. It'll adapt as I progress on the Google code,
but it's certainly of more use here in CVS than in my personal tree.
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Wed, 09 Nov 2005 08:07:20 +0000 |
| parents | 4d9686e7c234 |
| children | 6fd82071a7b8 |
| rev | line source |
|---|---|
| 11170 | 1 $MODULE_NAME = "Account Functions Test"; |
| 2 | |
| 3 use Gaim; | |
| 4 | |
| 5 # All the information Gaim gets about our nifty plugin | |
| 6 %PLUGIN_INFO = ( | |
| 7 perl_api_version => 2, | |
| 8 name => " Perl: $MODULE_NAME", | |
| 9 version => "0.1", | |
| 10 summary => "Test plugin for the Perl interpreter.", | |
| 11 description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface. As XSUBs are added, this *should* be updated to test the changes. Furthermore, this will function as the tutorial perl plugin.", | |
|
11457
4d9686e7c234
[gaim-migrate @ 13696]
Richard Laager <rlaager@wiktel.com>
parents:
11170
diff
changeset
|
12 author => "John H. Kelm <johnhkelm\@gmail.com>", |
| 11170 | 13 url => "http://sourceforge.net/users/johnhkelm/", |
| 14 | |
| 15 load => "plugin_load", | |
| 16 unload => "plugin_unload" | |
| 17 ); | |
| 18 | |
| 19 | |
| 20 # These names must already exist | |
| 21 my $GROUP = "UIUC Buddies"; | |
| 22 my $USERNAME = "johnhkelm2"; | |
| 23 | |
| 24 # We will create these on load then destroy them on unload | |
| 25 my $TEST_GROUP = "perlTestGroup"; | |
| 26 my $TEST_NAME = "perlTestName"; | |
| 27 my $TEST_ALIAS = "perlTestAlias"; | |
| 28 my $PROTOCOL_ID = "prpl-oscar"; | |
| 29 | |
| 30 | |
| 31 sub plugin_init { | |
| 32 return %PLUGIN_INFO; | |
| 33 } | |
| 34 | |
| 35 | |
| 36 # This is the sub defined in %PLUGIN_INFO to be called when the plugin is loaded | |
| 37 # Note: The plugin has a reference to itself on top of the argument stack. | |
| 38 sub plugin_load { | |
| 39 my $plugin = shift; | |
| 40 print "#" x 80 . "\n\n"; | |
| 41 Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Started."); | |
| 42 print "\n\n"; | |
| 43 | |
| 44 | |
| 45 ################################# | |
| 46 # # | |
| 47 # Gaim::Account::Option # | |
| 48 # # | |
| 49 ################################# | |
| 50 | |
| 51 print "Testing: Gaim::Account::Option::new...\n"; | |
| 52 $account_opt = Gaim::Account::Option::new(1, "TEXT", "pref_name"); | |
| 53 Gaim::Account::Option::bool_new("TeXt", "MYprefName", 1); | |
| 54 | |
| 55 ################################# | |
| 56 # # | |
| 57 # Gaim::Account # | |
| 58 # # | |
| 59 ################################# | |
| 60 | |
| 61 | |
| 62 print "Testing: Gaim::Account::new()..."; | |
| 63 $account = Gaim::Account::new($TEST_NAME, $PROTOCOL_ID); | |
| 64 if ($account) { print "ok.\n"; } else { print "fail.\n"; } | |
| 65 | |
| 66 print "Testing: Gaim::Account::add()..."; | |
| 67 Gaim::Accounts::add($account); | |
| 68 print "pending find...\n"; | |
| 69 | |
| 70 print "Testing: Gaim::Accounts::find()..."; | |
| 71 $account = Gaim::Accounts::find($TEST_NAME, $PROTOCOL_ID); | |
| 72 if ($account) { print "ok.\n"; } else { print "fail.\n"; } | |
| 73 | |
| 74 print "Testing: Gaim::Account::get_username()..."; | |
| 75 $user_name = Gaim::Account::get_username($account); | |
| 76 if ($user_name) { print $user_name . "...ok.\n"; } else { print "fail.\n"; } | |
| 77 | |
| 78 | |
| 79 print "Testing: Gaim::Account::is_connected()"; | |
| 80 $user_connected = Gaim::Account::is_connected($account); | |
| 81 if (!($user_connected)) { print "...not connected...ok..\n"; } else { print "...connected...ok.\n"; } | |
| 82 | |
| 83 | |
| 84 print "Testing: Gaim::Accounts::get_active_status()..."; | |
| 85 $status = Gaim::Account::get_active_status($account); | |
| 86 if ($status) { print "ok.\n"; } else { print "fail.\n"; } | |
| 87 | |
| 88 $account = Gaim::Accounts::find($USERNAME, $PROTOCOL_ID); | |
| 89 print "Testing: Gaim::Accounts::connect()...pending...\n"; | |
| 90 | |
| 91 Gaim::Account::set_status($account, "available", TRUE); | |
| 92 Gaim::Account::connect($account); | |
| 93 | |
| 94 print "\n\n"; | |
| 95 Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Completed."); | |
| 96 print "\n\n" . "#" x 80 . "\n\n"; | |
| 97 } | |
| 98 | |
| 99 sub plugin_unload { | |
| 100 my $plugin = shift; | |
| 101 | |
| 102 print "#" x 80 . "\n\n"; | |
| 103 Gaim::debug_info("plugin_unload()", "Testing $MODULE_NAME Started."); | |
| 104 print "\n\n"; | |
| 105 | |
| 106 ######### TEST CODE HERE ########## | |
| 107 | |
| 108 print "\n\n"; | |
| 109 Gaim::debug_info("plugin_unload()", "Testing $MODULE_NAME Completed."); | |
| 110 print "\n\n" . "#" x 80 . "\n\n"; | |
| 111 } | |
| 112 |
