AnyEvent-IRC

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - channel_list() now also optionally accepts the channel as first argument
        - the connect method of AnyEvent::IRC::Client now accepts an additional parameter
          where you can pass the register information for automatic registration.
        - the 'registered' event is now only emitted when the irc
          commands 376 or 422 have been seen.
        - added ctcp_auto_reply() method to AnyEvent::IRC::Client interface.
        - Util::mk_msg does NOT append "\015\012" anymore.
        - send_srv queue is now flushed in an event callback.

0.5     Sun Mar 11 23:54:10 CET 2007
        - added server password support
        - fixed a bug with nick-changing
        - added topic support
        - fixed problem in prefix matching
        - fixed a bug where channel_add was called with already
          joined nicks, these duplicates are now prevented.
        - found a bug in prefix_host with the tests
        - added some tests
        - disconnect now also does send channel_add/remove events
        - enhanced connection handling a bit
        - added connect and connect_error events to Net::IRC3::Connection

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

IRC server upon connect for you, and you won't have to call the C<register>
method yourself. If C<$info> only contains the timeout value it will not
automatically connect, this way you can pass a custom connect timeout value
without having to register.

The keys of the hash reference you can pass in C<$info> are:

   nick      - the nickname you want to register as
   user      - your username
   real      - your realname
   password  - the server password
   timeout   - the TCP connect timeout

All keys, except C<nick> are optional.

=cut

sub connect {
   my ($self, $host, $port, $info) = @_;

   my $timeout = delete $info->{timeout};

   if (defined $info and keys %$info) {
      $self->{register_cb_guard} = $self->reg_cb (
         ext_before_connect => sub {
            my ($self, $err) = @_;

            unless ($err) {
               $self->register (
                  $info->{nick}, $info->{user}, $info->{real}, $info->{password}
               );
            }

            delete $self->{register_cb_guard};
         }
      );
   }

   $self->SUPER::connect ($host, $port, $timeout);
}



( run in 0.491 second using v1.01-cache-2.11-cpan-49f99fa48dc )