Protocol-IRC

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

      Initially false. Will be set to true the first time a handler returns
      a true value.

    prefix_nick => STRING

    prefix_user => STRING

    prefix_host => STRING

      Values split from the message prefix; see the Protocol::IRC::Message
      prefix_split method.

    prefix_name => STRING

      Usually the prefix nick, or the hostname in case the nick isn't
      defined (usually on server messages).

    prefix_is_me => BOOL

      True if the nick mentioned in the prefix refers to this connection.

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

sub on_message_CAP
{
   my $self = shift;
   my ( $message, $hints ) = @_;

   my $verb = $message->arg(1);

   my %hints = (
      %$hints,
      verb => $verb,
      caps => { map { $_ => 1 } split m/ /, $message->arg(2) },
   );

   $self->invoke( "on_message_cap_$verb", $message, \%hints ) and $hints{handled} = 1;
   $self->invoke( "on_message_cap", $verb, $message, \%hints ) and $hints{handled} = 1;

   return $hints{handled};
}

=head2 MODE (on channels) and 324 (RPL_CHANNELMODEIS)

lib/Protocol/IRC/Message.pm  view on Meta::CPAN


=cut

sub new_from_line
{
   my $class = shift;
   my ( $line ) = @_;

   my %tags;
   if( $line =~ s/^\@([^ ]+) +// ) {
      foreach ( split m/;/, $1 ) {
         if( m/^([^=]+)=(.*)$/ ) {
            $tags{$1} = $2;
         }
         else {
            $tags{$_} = undef;
         }
      }
   }

   my $prefix;

lib/Protocol/IRC/Message.pm  view on Meta::CPAN


Paul Evans <leonerd@leonerd.org.uk>

=cut

local $_;
while( <DATA> ) {
   chomp;
   m/^\s*#/ and next; # ignore comments

   my ( $cmdname, $args, $gating ) = split m/\s*\|\s*/, $_ or next;
   my ( $cmd, $name ) = split m/=/, $cmdname;

   my $index = 0;
   my %args = map {
      if( m/^(.*)=(.*)$/ ) {
         $index = $1;
         ( $2 => $1 )
      }
      else {
         ( $_ => ++$index );
      }
   } split m/,/, $args;

   $NUMERIC_NAMES{$cmd} = $name;
   $ARG_NAMES{$cmd} = \%args;
   $GATE_DISPOSITIONS{$cmd} = $gating if defined $gating;
}
close DATA;

0x55AA;

# And now the actual numeric definitions, given in columns



( run in 1.121 second using v1.01-cache-2.11-cpan-5511b514fd6 )