changeset 29398:ae1c7756f1bd

Add timeout_add() example to the Perl signals-test plugin
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 18 Feb 2010 16:43:29 +0000
parents fff648ea95ae
children 36da826c6002
files libpurple/plugins/perl/scripts/signals-test.pl
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/scripts/signals-test.pl	Thu Feb 18 16:37:18 2010 +0000
+++ b/libpurple/plugins/perl/scripts/signals-test.pl	Thu Feb 18 16:43:29 2010 +0000
@@ -44,6 +44,11 @@
 	Purple::Debug::misc("signals test in perl", "$data (" . $account->get_username() . ", $sender, $message, $flags)\n");
 }
 
+sub timeout_cb
+{
+	Purple::Debug::misc("signals test in perl", "timeout elapsed\n");
+}
+
 sub plugin_load
 {
 	my $plugin = shift;
@@ -71,6 +76,9 @@
 					\&conv_received_msg, "received im message");
 	Purple::Signal::connect($conv, "received-chat-msg", $plugin,
 					\&conv_received_msg, "received chat message");
+
+
+	Purple::timeout_add($plugin, 10, \&timeout_cb);
 }
 
 sub plugin_unload