POE-Component-Server-IRC

 view release on metacpan or  search on metacpan

docs/rfc1459.txt  view on Meta::CPAN



Oikarinen & Reed                                               [Page 18]

RFC 1459              Internet Relay Chat Protocol              May 1993


   Similarly, a QUIT message must be sent to the other connected servers
   rest of the network on behalf of all clients behind that link.  In
   addition to this, all channel members of a channel which lost a
   member due to the split must be sent a QUIT message.

   If a server connection is terminated prematurely (e.g. the server  on
   the  other  end  of  the  link  died),  the  server  which  detects
   this disconnection is required to inform the rest of  the  network
   that  the connection  has  closed  and  fill  in  the comment field
   with something appropriate.

   Numeric replies:

           ERR_NOPRIVILEGES                ERR_NOSUCHSERVER

lib/POE/Component/Server/IRC.pm  view on Meta::CPAN

    my $args   = [@_];
    my $count  = @$args;

    SWITCH: {
        if (!$count) {
            $args->[0] = 'l';
        }
        my $uid = $self->state_user_uid($nick);
        my $watches = $self->{state}{uids}{$uid}{watches} || { };
        my $list = 0;
        ITEM: foreach my $item ( split m!,!, $args->[0] ) {
            if ( $item =~ m!^\+! ) {
               $item =~ s!^\+!!;
               if ( keys %$watches >= $self->{config}{max_watch} ) {
                  push @$ref, ['512', $self->{config}{max_watch}];
                  next ITEM;
               }
               next ITEM if !$item || !is_valid_nick_name($item);
               # Add_to_watch_list
               $watches->{uc_irc $item} = $item;
               $self->{state}{watches}{uc_irc $item}{uids}{$uid} = 1;

lib/POE/Component/Server/IRC.pm  view on Meta::CPAN

              params  => $args,
          },
          grep { $_ ne $peer_id } $self->_state_connected_peers(),
        );
        my $mode_u_set = ( $chanrec->{mode} =~ /u/ );
        my $sid = $self->server_sid();
        my $server = $self->server_name();
        my @local_users = map { $self->_state_uid_route( $_ ) }
                           grep { !$mode_u_set || $chanrec->{users}{$_} =~ /[oh]/ }
                           grep { $_ =~ m!^$sid! } keys %{ $chanrec->{users} };
        my @mask_list = split m!\s+!, $masks;
        my @marsk_list;
        foreach my $marsk ( @mask_list ) {
            my $mask = normalize_mask($marsk);
            my $umask = uc_irc($mask);
            next if $chanrec->{ $map{ $trype } }{$umask};
            $chanrec->{ $map{ $trype } }{$umask} =
              [ $mask, $server, time() ];
            push @marsk_list, $marsk;
        }
        # Only bother with the next bit if we have local users on the channel

lib/POE/Component/Server/IRC.pm  view on Meta::CPAN

              },
              $conn_id, '', 'extended-join', 'chghost'
           );
           if ($modeline) {
              $self->_send_output_channel_local(
                  $chan,
                  {
                      prefix   => $server,
                      command  => 'MODE',
                      colonify => 0,
                      params   => [ $chan, split m! !, $modeline ],
                  },
                  $conn_id, '', '', 'chghost'
              );
           }
           if ($rec->{away}) {
              $self->_send_output_channel_local(
                  $chan,
                  {
                      prefix   => $full,
                      command  => 'AWAY',

lib/POE/Component/Server/IRC/Help.pm  view on Meta::CPAN

}

sub topic {
    my $self = shift;
    my $topic = shift || return;
    my $lines = [];

    $topic = lc $topic;
    my $method = '_' . $topic;
    return unless eval { $self->can($method) };
    push @$lines, $_ for split m!\n!, $self->$method;
    return @$lines if wantarray;
    return $lines;
}

sub _accept {
  return << 'EOT'
ACCEPT [parameter]

ACCEPT allows you to control who can send you a NOTICE or PRIVMSG
while you have user mode +g enabled.

lib/POE/Component/Server/IRC/Help.pm  view on Meta::CPAN

       * y     - Can see stats/links/admin requests to name a few.
       * d     - Can see server debug messages.
       * n     - Can see client nick changes.
         p     - Hides channel list in WHOIS.
         q     - Hides idle and signon time in WHOIS.
         r     - User has been registered and identified for its nick.
                 Can be set only by servers and services.
         R     - Only registered clients may message you.
         s     - Can see generic server messages and oper kills.
         S     - Client is connected via SSL/TLS.
       * e     - Can see new server introduction and split messages.
       * b     - Can see possible bot/join flood warnings.
       * a     - Is marked as a server admin in stats o/p.
         D     - "Deaf": don't receive channel messages.
         G     - "Soft Caller ID": block private messages from people not on
                 any common channels with you (unless they are accepted).
         g     - "Caller ID" mode: only allow accepted clients to message you.
       * H     - IRC operator status is hidden to other users.
EOT
}

t/ts6_25_list1.t  view on Meta::CPAN

  $kernel->post( $sender, 'send_to_server', { command => 'SVINFO', params => [ '6', '6', '0', time() ], colonify => 1 } );
  $uidts = time() - 20;
  $kernel->post( $sender, 'send_to_server', { prefix => '7UP', command => 'SID', params => [ 'fake.server.irc', 2, '4AK', 'This is a fake server' ] } );
  $kernel->post( $sender, 'send_to_server', { prefix => '7UP', command => 'UID', params => [ 'groucho', '1', $uidts, '+aiow', 'groucho', 'groucho.marx', '0', $g_gen->_state_gen_uid(), '0', 'Groucho Marx' ], colonify => 1 } );
  $kernel->post( $sender, 'send_to_server', { prefix => '7UPAAAAAA', command => 'AWAY', params => [ 'A minute and a huff' ], colonify => 1 } );
  my $i = 0;
  my @uids;
  while( $i++ < 150 ) {
    my $str = shift @users;
    next if !$str;
    my ($nick,$usr,$host) = split m/[!@]/, $str;
    my $uid = $g_gen->_state_gen_uid();
    push @uids, $uid;
    $kernel->post( $sender, 'send_to_server', { prefix => '7UP', command => 'UID', params => [ $nick, '1', ($uidts-int(rand(1000))), '+i', $usr, $host, '0', $uid, '0', $usr ], colonify => 1 } );
  }
  $kernel->post( $sender, 'send_to_server', { prefix => '7UP', command => 'SJOIN', params => [ ( time() - 50 ), '#marxbros', '+nt', '@7UPAAAAAA' ], colonify => 1 } );
  foreach my $chan ( sort keys %channels ) {
    my $len = 28 + length $chan;
    my $mode = ( $channels{$chan}{mode} || '+nt' );
    my $rec = [ $channels{$chan}{ts}, $chan, $mode ];
    my $j = 0; my $buf = '';

t/ts6_25_list1.t  view on Meta::CPAN

  $kernel->post( $sender, 'send_to_server', { command => 'CAPAB', params => [ 'KNOCK UNDLN DLN TBURST GLN ENCAP UNKLN KLN CHW IE EX HOPS SVS CLUSTER EOB QS' ], colonify => 1 } );
  $kernel->post( $sender, 'send_to_server', { command => 'SERVER', params => [ 'harpo.server.irc', '1', 'Open the door and come in!!!!!!' ], colonify => 1 } );
  $kernel->post( $sender, 'send_to_server', { command => 'SVINFO', params => [ '6', '6', '0', time() ], colonify => 1 } );
  $uidts = time() - 50;
  $kernel->post( $sender, 'send_to_server', { prefix => '9T9', command => 'UID', params => [ 'harpo', '1', $uidts, '+aiow', 'harpo', 'harpo.marx', '0', $h_gen->_state_gen_uid(), '0', 'Harpo Marx' ], colonify => 1 } );
  my $i = 0;
  my @uids;
  while( $i++ < 150 ) {
    my $str = shift @users;
    next if !$str;
    my ($nick,$usr,$host) = split m/[!@]/, $str;
    my $uid = $h_gen->_state_gen_uid();
    push @uids, $uid;
    $kernel->post( $sender, 'send_to_server', { prefix => '9T9', command => 'UID', params => [ $nick, '1', ($uidts-int(rand(1000))), '+i', $usr, $host, '0', $uid, '0', $usr ], colonify => 1 } );
  }
  $kernel->post( $sender, 'send_to_server', { prefix => '9T9', command => 'SJOIN', params => [ ( time() - 50 ), '#marxbros', '+nt', '@9T9AAAAAA' ], colonify => 1 } );
  foreach my $chan ( sort keys %channels ) {
    my $len = 27 + length $chan;
    my $rec = [ $channels{$chan}{ts}, $chan, '+nt' ];
    my $j = 0; my $buf = '';
    UID: while ( $j < $channels{$chan}{users} ) {



( run in 0.795 second using v1.01-cache-2.11-cpan-71847e10f99 )