ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-XMPP2/samples/simple_example_1
Revision: 1.2
Committed: Fri Jul 6 22:22:21 2007 UTC (19 years, 5 months ago) by elmex
Branch: MAIN
Changes since 1.1: +1 -1 lines
Log Message:
implemented dataforms - phew! that was a bullet of work

File Contents

# Content
1 #!/opt/perl/bin/perl
2 use strict;
3 use utf8;
4 use Event;
5 use AnyEvent;
6 use Net::XMPP2::Client;
7
8 my $j = AnyEvent->condvar;
9 my $cl = Net::XMPP2::Client->new;
10 $cl->add_account ('net_xmpp2@jabber.org', 'test');
11 $cl->reg_cb (
12 session_ready => sub {
13 $cl->send_message (
14 "Hi! I'm too stupid to adjust examples!" => 'elmex@jabber.org'
15 );
16 0
17 },
18 message => sub {
19 my ($cl, $acc, $msg) = @_;
20 print "message from: " . $msg->from . ": " . $msg->any_body . "\n";
21 1
22 }
23 );
24
25 $cl->start;
26 $j->wait;
27