diff --git a/plugins/Net-Demo.pl b/plugins/Net-Demo.pl new file mode 100644 index 0000000..69490bd --- /dev/null +++ b/plugins/Net-Demo.pl @@ -0,0 +1,29 @@ +package NetDemo; + +use Milkbone; + +use strict; +use warnings; + +register_hook "protocol_signon", sub { + hook("after", -time => 10, -code => sub { hook("signed_in") }); + + register_hook "protocol_add_buddy", sub { hook("buddy_in", -buddy => + $ARGS{-buddy}, -group => $ARGS{-group}); }; + + register_hook "protocol_get_groups", sub { return ["Buddies", "You"] }; + register_hook "protocol_get_realname", sub { return uc $ARGS{-user} }; + register_hook "protocol_request_info", sub { + hook("protocol_info_received_$ARGS{-user}", + -profile => 'test', -away => 'test'); + }; + + hook("after", -time => 1000, -code => sub { + hook("buddy_in", -group => 'Buddies', -buddy => $_); }) + for qw(althor57 perlmonk86); + hook("after", -time => 1000, -code => sub { + hook("msg_in", -user => 'thatguy', -msg => 'hey'); + }); +}; + +1;