Update of /cvsroot/gaim/gaim/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv3194/plugins
Modified Files:
PERL-HOWTO gaim.pl
Log Message:
gaim.pl works like it should now
Index: PERL-HOWTO
===================================================================
RCS file: /cvsroot/gaim/gaim/plugins/PERL-HOWTO,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- PERL-HOWTO 2001/09/22 09:14:27 1.9
+++ PERL-HOWTO 2001/09/24 19:32:57 1.10
@@ -45,6 +45,7 @@
4 - given a connection index, the index in the users list
5 - the list of names of users
6 - the list of protocols of the users
+ 7 - given a connection index, the name of the protocol (as a string)
GAIM::print(title, message)
This displays a nice little dialog window.
Index: gaim.pl
===================================================================
RCS file: /cvsroot/gaim/gaim/plugins/gaim.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gaim.pl 2001/03/03 06:19:19 1.2
+++ gaim.pl 2001/09/24 19:32:57 1.3
@@ -1,24 +1,30 @@
GAIM::register("gaim test", "0.0.1", "goodbye", "");
$ver = GAIM::get_info(0);
-$nam = GAIM::get_info(1);
-$pro = GAIM::get_info(2, $nam);
+@ids = GAIM::get_info(1);
-GAIM::print("Perl Says", "Gaim $ver, $nam using $pro");
+$msg = "Gaim $ver:";
+foreach $id (@ids) {
+ $pro = GAIM::get_info(7, $id);
+ $nam = GAIM::get_info(3, $id);
+ $msg .= "\n$nam using $pro";
+}
-GAIM::command("idle", 60000);
+GAIM::print("Perl Says", $msg);
-GAIM::add_event_handler("event_buddy_signon", "say_hello");
-GAIM::add_timeout_handler(600, "notify");
+GAIM::command("idle", 6000);
+GAIM::add_event_handler("event_buddy_signon", "echo_reply");
+GAIM::add_timeout_handler(60, "notify");
+
sub echo_reply {
- $args = @_;
- $args =~ s/\"//g;
- GAIM::print_to_conv($args, "Hello");
+ $args = $_[0];
+ $args =~ s/(.+) \"(.+)\"//;
+ GAIM::print_to_conv($1, $2, "Hello", 0);
}
sub notify {
- GAIM::print("10 minutes", "gaim test has been loaded for 10 minutes");
+ GAIM::print("1 minute", "gaim test has been loaded for 1 minute");
}
sub goodbye {
|