You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.8 KiB
57 lines
1.8 KiB
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 lc $ARGS{-user} }; |
|
register_hook "protocol_request_info", sub { |
|
hook("after", -time => 1000, -code => sub { |
|
hook("protocol_info_received_$ARGS{-user}", |
|
-profile => 'test', -away => 'test'); |
|
}); |
|
}; |
|
|
|
register_hook "protocol_send_im", sub { |
|
hook("after", -time => 500, -code => [sub { |
|
hook("msg_sent_$_[0]", -user => $_[0], -msg => $_[1], -away => 0); |
|
hook("after", -time => 500, sub { |
|
hook("msg_in", -user => $_[0], -msg => $_[1], -away => 0); |
|
hook("msg_in_$_[0]", -user => $_[0], -msg => $_[1], -away => 0); |
|
}); |
|
}, $ARGS{-dest}, $ARGS{-msg}]); |
|
}; |
|
register_hook "protocol_away_status", sub { 0 }; |
|
|
|
hook("after", -time => 1000, -code => sub { |
|
hook("buddy_in", -group => 'Buddies', -buddy => 'test_user'); |
|
}); |
|
|
|
# hook("after", -time => 1000, -code => sub { |
|
# hook("msg_in", -user => 'thatguy', -msg => '<b>hey</b>'); |
|
# }); |
|
|
|
# hook("after", -time => 1500, -code => sub { |
|
# hook("protocol_send_im", -dest => 'thatguy', -msg => '<b>hey there</b>'); |
|
|
|
hook("after", -time => 500, -code => sub { |
|
register_hook "protocol_chat_accept", sub { |
|
hook("protocol_chat_joined", -name => 'erer', -user => 'er', |
|
-url => 'ere'); |
|
hook("protocol_chat_buddy_in_ere", -user => 'charles'); |
|
}; |
|
|
|
hook("protocol_chat_invited", -user => 'thatguy', |
|
-url => 'er'); |
|
}); |
|
}; |
|
|
|
1;
|
|
|