my $cl = AnyEvent::XMPP::Client->new();
$cl->set_accounts({
'
[email protected]' => [ 'PASSWORD', 'talk.google.com', 5223, { domain =>
'gmail.com', old_style_ssl => 1 } ],
'
[email protected]' => [ 'PASSWORD', 'talk.google.com', 5223, { domain =>
'gmail.com', old_style_ssl => 1 } ]
});
$cl->reg_cb(
message => sub {
my ($client, $account, $message) = @_;
$client->send_message("Nihao", $message->from, $account->jid);
},
contact_request_subscribe => sub {
my ($client, $account, $roster, $contact, $message) = @_;
$contact->send_subscribed;
},
disconnect => sub {
my $client = shift;
$client->update_connections;
}
);
$cl->start;
12年4月14日星期六