1 $MODULE_NAME = "Signals Test Script in Perl";
7 name
=> "Perl: $MODULE_NAME",
9 summary
=> "Signals Test plugin for the Perl interpreter.",
10 description
=> "Demonstrate the use of purple signals from " .
12 author
=> "Sadrul Habib Chowdhury <sadrul\@pidgin.im>",
13 url
=> "http://developer.pidgin.im/wiki/sadrul/",
15 load
=> "plugin_load",
16 unload
=> "plugin_unload"
20 sub account_connecting_cb
23 Purple
::Debug
::misc
("signals test in perl", "account-connecting (" . $account->get_username() . ")\n");
30 Purple
::Debug
::misc
("signals test in perl", "buddy-signed-on (" . $buddy->get_name() . ")\n");
37 Purple
::Debug
::misc
("signals test in perl", "signed-on (" . $conn->get_account()->get_username() . ")\n");
43 my ($account, $sender, $message, $conv, $flags, $data) = @_;
44 Purple
::Debug
::misc
("signals test in perl", "$data (" . $account->get_username() . ", $sender, $message, $flags)\n");
54 $act_handle = Purple
::Accounts
::get_handle
();
55 Purple
::Signal
::connect($act_handle, "account-connecting", $plugin,
56 \
&account_connecting_cb
, 0);
59 $blist = Purple
::BuddyList
::get_handle
();
60 Purple
::Signal
::connect($blist, "buddy-signed-on", $plugin,
61 \
&buddy_signed_on
, 0);
64 $conn = Purple
::Connections
::get_handle
();
65 Purple
::Signal
::connect($conn, "signed-on", $plugin,
69 $conv = Purple
::Conversations
::get_handle
();
70 Purple
::Signal
::connect($conv, "received-im-msg", $plugin,
71 \
&conv_received_msg
, "received im message");
72 Purple
::Signal
::connect($conv, "received-chat-msg", $plugin,
73 \
&conv_received_msg
, "received chat message");
78 # Nothing to do here for this plugin.