AnyEvent-XMPP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

         - added a sample bot samples/talkbot
         - fixed small issue in Writer.pm
         - added other sample bot samples/talkbot_channel
         - added sample script to retrieve roster: samples/retrieve_roster

0.07 Tue Aug 14 19:22:11 CEST 2007
         - implemented whitespace ping and:
            - XEP-0199 - XMPP Ping
         - added next_iq_id() method to Net::XMPP2::Connection
         - additions to Net::XMPP2::Event, you can now implement guards
           for unregistration of registered event callbacks. You can also
           remove all callbacks now and event names are case sensitive now.
         - Net::XMPP2::Client adding already existing accounts
           now updates them.
         - further todo items killed for MUC support
         - implemented mapping of old error codes to the new condition strings
           and the other way around too in Net::XMPP2::Error::Stanza
         - fallback namespace function for simxml() is now enabled all the time,
           now default namespaces are nearly always generated an the namespace of a
           node fallsback to the parent node if none was supplied.
         - increased test timeout to 20 secs and offered an environment variable
           to override it.

Changes  view on Meta::CPAN

         - added send_*_hook event hooks for future extensions
           like the entity capabilities to be able to add payload
           to outgoing stanzas

0.02 Wed Jul 11 22:55:56 CEST 2007
         - added iq_xml event
         - added development client example in samples/devcl/
         - added some debugging events: debug_recv, debug_send, send_stanza_data,
           and recv_stanza_xml.
         - the error event now also provides error reporting
           about exceptions (eq. in IQ callbacks, which is certainly
           useful for development!)
         - fixed error in binding-handling in case the bind iq gets a timeout
         - added samples/room_lister* and samples/conference_lister
         - redesigned disco mechanism a bit
         - added error collection event for nicer error reporting capabilities
         - added samples/disco_test
         - implemented XEP-0004
         - added samples/limit_searcher
         - added simxml()
         - splitting up large packets when writing

README  view on Meta::CPAN

REQUIREMENTS
    One of the major drawbacks I see for AnyEvent::XMPP is the long list of
    required modules to make it work.

    AnyEvent
        For the I/O events, timers, TCP, TLS, DNS and I/O buffering.

    Object::Event
        The former AnyEvent::XMPP::Event module has been outsourced to the
        Object::Event module to provide a more generic way for more other
        modules to register and call event callbacks.

    XML::Writer
        For writing "XML".

    XML::Parser::Expat
        For parsing partial "XML" stuff.

    MIME::Base64
        For SASL authentication

TODO  view on Meta::CPAN

      - 10.8 Modifying the Admin List
      - 10.9 Destroying a Room
   - 7.6 Converting a One-to-One Chat Into a Conference

- write a tutorial for simxml
- improve the SSL/TLS handling
- make more tests
   - oob
   - data forms
   - jabber component
- fix the inaviodable memoryleaks with the callbacks
  the circular object structs.
- put some serious stuff in the synopsises
- look at attribute namespace preservation! (if they got
  prefixes, how to parse this with expat?
  see also http://www.w3.org/TR/REC-xml-names/#scoping-defaulting )
- fix problem that xml::writer writes after <stream/> ahs been written
  - reproduce by conflicting resources!
- test the xml parse error object somehow!
- add context field to IQ error for all the places origin from IQ errors
  (bind_error, session_error, ...)

lib/AnyEvent/XMPP.pm  view on Meta::CPAN

=over 4

=item L<AnyEvent>

For the I/O events, timers, TCP, TLS, DNS and I/O buffering.

=item L<Object::Event>

The former L<AnyEvent::XMPP::Event> module has been outsourced to the L<Object::Event>
module to provide a more generic way for more other modules to register and call
event callbacks.

=item L<XML::Writer>

For writing "XML".

=item L<XML::Parser::Expat>

For parsing partial "XML" stuff.

=item L<MIME::Base64>

lib/AnyEvent/XMPP/Client.pm  view on Meta::CPAN

=head1 METHODS

=head2 new (%args)

Following arguments can be passed in C<%args>:

=over 4

=item debug => 1

This will install callbacks which produce debugging output. This will
require L<XML::Twig> to be installed (as it is used for pretty printing
the "XML" output).

=back

=cut

sub new {
   my $this = shift;
   my $class = ref($this) || $this;

lib/AnyEvent/XMPP/Component.pm  view on Meta::CPAN

       ."AnyEvent::XMPP::Component why this is an error!"
}

=back

=head1 EVENTS

These additional events can be registered on with C<reg_cb>:

NOTE: The event C<stream_pre_authentication> should _not_ be handled
and just ignored. Don't attach callbacks to it!

=over 4

=item session_ready

This event indicates that the component has connected successfully
and can now be used to transmit stanzas.

=back

lib/AnyEvent/XMPP/Connection.pm  view on Meta::CPAN

to a true value.
If the stanza was not handled an error iq will be generated.

=item iq_result_cb_exception => $exception

If the C<$result_cb> of a C<send_iq> operation somehow threw a exception
or failed this event will be generated.

=item send_iq_hook => $id, $type, $attrs, \@create_cb

This event lets you add any desired number of additional create callbacks
to a IQ stanza that is about to be sent.

C<$id>, C<$type> are described in the documentation of C<send_iq> of
L<AnyEvent::XMPP::Writer>. C<$attrs> is the hashref to the C<%attrs> hash that can
be passed to C<send_iq> and also has the exact same semantics as described in
the documentation of C<send_iq>.

You can push values into C<create_cb> (as documented for C<send_iq>), for
example a callback that fills the IQ.

lib/AnyEvent/XMPP/Connection.pm  view on Meta::CPAN

         my $w = shift; # $w is a XML::Writer instance
         $w->emptyTag ('test');
      };
      push @$create_cb, {
         node => { name => "test2" } # see also simxml() defined in AnyEvent::XMPP::Util
      };
   });

=item send_message_hook => $id, $to, $type, $attrs, \@create_cb

This event lets you add any desired number of additional create callbacks
to a message stanza that is about to be sent.

C<$id>, C<$to>, C<$type> and the hashref C<$attrs> are described in the documentation
for C<send_message> of L<AnyEvent::XMPP::Writer> (C<$attrs> is C<%attrs> there).

To actually append something you need to push into C<create_cb> as described in
the C<send_iq_hook> event above.

=item send_presence_hook => $id, $type, $attrs, \@create_cb

This event lets you add any desired number of additional create callbacks
to a presence stanza that is about to be sent.

C<$id>, C<$type> and the hashref C<$attrs> are described in the documentation
for C<send_presence> of L<AnyEvent::XMPP::Writer> (C<$attrs> is C<%attrs> there).

To actually append something you need to push into C<create_cb> as described in
the C<send_iq_hook> event above.

=back

lib/AnyEvent/XMPP/Ext/MUC.pm  view on Meta::CPAN


   my $con = AnyEvent::XMPP::Connection->new (...);
   $con->add_extension (my $disco = AnyEvent::XMPP::Ext::Disco->new);
   $con->add_extension (my $muc = AnyEvent::XMPP::Ext::MUC->new (disco => $disco));
   ...

=head1 DESCRIPTION

This module handles multi user chats and provides new events to catch
multi user chat messages. It intercepts messages from the connection
so they don't interfere with your other callbacks on the connection.

This extension requires the L<AnyEvent::XMPP::Ext::Disco> extension for service
discovery.

=cut

=head1 METHODS

=over 4

lib/AnyEvent/XMPP/IM/Account.pm  view on Meta::CPAN


   my $bjid = prep_bare_jid $msg->to;
   $msg->to ($self->{track}->{$bjid} || $bjid);
   $msg->send ($self->connection)
}

=back

=head1 EVENTS

For these events callbacks can be registered (with the L<Object::Event> interface):

=over 4

=item tracked_message_destination => $bare_jid, $full_jid

This event is emitted whenever the message tracking mechanism changes (or sets)
it's destination resource for the C<$bare_jid> to C<$full_jid>.

=item removed

lib/AnyEvent/XMPP/IM/Connection.pm  view on Meta::CPAN


=head1 EVENTS

These additional events can be registered on with C<reg_cb>:

In the following events C<$roster> is the L<AnyEvent::XMPP::IM::Roster>
object you get by calling C<get_roster>.

NODE: The first argument to each callback is always the L<AnyEvent::XMPP::IM::Connection>
object itself. Also see L<Object::Event> for more information about registering
callbacks.

=over 4

=item session_ready

This event is generated when the session has been fully established and
can be used to send around messages and other stuff.

=item session_error => $error

lib/AnyEvent/XMPP/SimpleConnection.pm  view on Meta::CPAN

   my ($self) = @_;

   $self->{handle}->starttls ('connect');
   $self->{ssl_enabled} = 1;
}

sub disconnect {
   my ($self, $msg) = @_;
   $self->end_sockets;
   $self->{disconnect_cb}->($self->{peer_host}, $self->{peer_port}, $msg);
   $self->remove_all_callbacks;
}

1;



( run in 0.369 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )