NAME
POE::Component::Jabber - POE component for accessing Jabber servers
SYNOPSIS
use POE::Component::Jabber;
POE::Component::Jabber->new( 'my client' );
$kernel->post( 'my client', 'register', qw( authed authfailed ) );
$kernel->post( 'my client', 'connect', {
host => 'localhost',
user => 'test',
resource => 'poe',
password => 'test',
debug => 1,
} );
DESCRIPTION
POE::Component::Jabber is heavily based on POE::Component::IRC and uses much the same event model. Authentication routines are inspired by Jabber::Connection.
POE::Filter::Jabber is provided which requires XML::Parser and sends and receives data as Jabber::NodeFactory::Node objects.
POE::Component::Jabber::Auth implements authentication with the jabber server. This would be a good module to look at as it does it in much the way an application would interface with POE::Component::Jabber by registering for the IQ event.
METHODS
- new
-
POE::Component::Jabber->new( 'my client' );
Takes one argument which will be the alias for the component.
EVENTS
These are the events you can call on the component.
- connect
-
$kernel->post( 'my client', 'connect', { host => 'localhost', user => 'test', resource => 'poe', password => 'test', debug => 1, } );
Connects to the Jabber server. Will trigger a jabber_connected on successful connection, or jabber_socketerr on failure. After successful authentication, a jabber_authed event is triggered. If authentication fails, a jabber_authfailed is triggered.
- disconnect
-
$kernel->post( 'my client', 'disconnect' );
Disconnects from the jabber server, will generate a jabber_disconnected event when complete.
- register
-
$kernel->post( 'my client', 'register', qw( authed authfailed ) );
Registers your session for a list of events.
- unregister
-
$kernel->post( 'my client', 'unregister', qw( authed authfailed ) );
De-registers your session for a list of events.
- send
-
$kernel->post( 'my client', 'send', $node );
Send a Jabber::NodeFactory::Node object to the jabber server.
- auth
-
$kernel->post( 'my client', 'auth', { type => NS_CLIENT, user => 'test', password => 'password', resource => 'resource', debug => 1, } );
Authenticate with the jabber server. Will send a jabber_authed or jabber_authfailed event.
BUGS
Bound to be loads, this is an early release. Also documentation sucks, will be improved when I have time.
AUTHOR
Original Code: Mark Cheverton, <ennui@morat.net> Maintained by: Mark A. Hershberger, <mah@everybody.org>
SEE ALSO
Jabber::Connection, POE::Component::IRC
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 373:
You forgot a '=back' before '=head1'