pastebot-cvs Mailing List for pastebot (Page 2)
Status: Beta
Brought to you by:
rcaputo
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(12) |
Jun
(6) |
Jul
(2) |
Aug
|
Sep
|
Oct
(14) |
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(11) |
Jul
(4) |
Aug
|
Sep
|
Oct
(16) |
Nov
(22) |
Dec
(6) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(10) |
Oct
|
Nov
(2) |
Dec
|
From: <ave...@us...> - 2003-11-30 16:05:17
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv6760/Client Modified Files: IRC.pm Log Message: Add a new flag, to forbid invites to unknown channels. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IRC.pm 13 Nov 2003 23:59:34 -0000 1.14 --- IRC.pm 30 Nov 2003 16:05:14 -0000 1.15 *************** *** 369,373 **** irc_invite => sub { my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; ! $kernel->yield( join => $where ); }, --- 369,380 ---- irc_invite => sub { my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; ! $where =~ s/^#//; ! if ( $conf{inviteany} && ! 1 > grep $_ eq $where, @{$conf{channel}} ) { ! print "$who invited me to $where, but i'm not allowed\n"; ! } ! else { ! $kernel->yield( join => "#$where" ) ! } }, |
From: <rc...@us...> - 2003-11-13 23:59:38
|
Update of /cvsroot/pastebot/pastebot/Util In directory sc8-pr-cvs1:/tmp/cvs-serv21401/Util Modified Files: Data.pm Log Message: Channel management functions did not take into account that the bot may be on multiple networks at once. Add network differentiation to the bot's database, IRC client, and web server. Index: Data.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Util/Data.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Data.pm 13 Nov 2003 04:08:49 -0000 1.6 --- Data.pm 13 Nov 2003 23:59:34 -0000 1.7 *************** *** 209,231 **** sub channels { ! return sort keys %channels; } sub clear_channels { ! %channels = (); ! return if keys %channels; # Should never happen return 1; } sub add_channel { ! my ($channel) = @_; $channel = lc($channel); ! $channels{$channel} = 1; } sub remove_channel { ! my ($channel) = @_; $channel = lc($channel); ! delete $channels{$channel}; # returns automatically } --- 209,235 ---- sub channels { ! my $network = lc(shift); ! return sort keys %{$channels{$network}}; } sub clear_channels { ! my $network = lc(shift); ! %{$channels{$network}} = (); ! return if keys %{$channels{$network}}; # Should never happen return 1; } sub add_channel { ! my ($network, $channel) = @_; ! $network = lc($network); $channel = lc($channel); ! $channels{$network}{$channel} = 1; } sub remove_channel { ! my ($network, $channel) = @_; ! $network = lc($network); $channel = lc($channel); ! delete $channels{$network}{$channel}; # returns automatically } |
From: <rc...@us...> - 2003-11-13 23:59:38
|
Update of /cvsroot/pastebot/pastebot/Server In directory sc8-pr-cvs1:/tmp/cvs-serv21401/Server Modified Files: Web.pm Log Message: Channel management functions did not take into account that the bot may be on multiple networks at once. Add network differentiation to the bot's database, IRC client, and web server. Index: Web.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Server/Web.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Web.pm 13 Nov 2003 04:25:08 -0000 1.17 --- Web.pm 13 Nov 2003 23:59:34 -0000 1.18 *************** *** 54,58 **** my ( $heap, $socket, $remote_address, $remote_port, ! $my_name, $my_host, $my_port, $my_ifname, $my_isrv, $proxy, $my_iname, ) = @_[HEAP, ARG0..$#_]; --- 54,58 ---- my ( $heap, $socket, $remote_address, $remote_port, ! $my_name, $my_host, $my_port, $my_ifname, $my_isrv, $proxy, $my_iname, ) = @_[HEAP, ARG0..$#_]; *************** *** 229,233 **** # Goes as a separate block. if (length $channel) { ! unless (grep $_ eq $channel, channels()) { $error = ( "<p><b><font size='+1' color='#800000'>" . --- 229,233 ---- # Goes as a separate block. if (length $channel) { ! unless (grep $_ eq $channel, channels($heap->{my_isrv})) { $error = ( "<p><b><font size='+1' color='#800000'>" . *************** *** 407,411 **** # file's list. ! my @tmpchans = channels(); my @channels; --- 407,411 ---- # file's list. ! my @tmpchans = channels($heap->{my_isrv}); my @channels; |
From: <rc...@us...> - 2003-11-13 23:59:38
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv21401/Client Modified Files: IRC.pm Log Message: Channel management functions did not take into account that the bot may be on multiple networks at once. Add network differentiation to the bot's database, IRC client, and web server. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** IRC.pm 13 Nov 2003 05:01:27 -0000 1.13 --- IRC.pm 13 Nov 2003 23:59:34 -0000 1.14 *************** *** 173,177 **** } else { ! @igchans = map lc, channels(); } # only the channels the user is an operator on --- 173,177 ---- } else { ! @igchans = map lc, channels($conf{name}); } # only the channels the user is an operator on *************** *** 376,380 **** my ($nick) = $who =~ /^([^!]+)/; if (lc ($nick) eq lc($heap->{my_nick})) { ! add_channel($where); $kernel->post( $server => who => $where ); } --- 376,380 ---- my ($nick) = $who =~ /^([^!]+)/; if (lc ($nick) eq lc($heap->{my_nick})) { ! add_channel($conf{name}, $where); $kernel->post( $server => who => $where ); } *************** *** 389,393 **** delete $heap->{users}{$where}{$nick}; if (lc($nick) eq lc($heap->{my_nick})) { ! remove_channel($where); delete $heap->{users}{$where}; } --- 389,393 ---- delete $heap->{users}{$where}{$nick}; if (lc($nick) eq lc($heap->{my_nick})) { ! remove_channel($conf{name}, $where); delete $heap->{users}{$where}; } *************** *** 431,435 **** if ($_ eq "o") { if ($set eq "+") { ! $heap->{users}{$location}{$target}{mode} .= "@" unless $heap->{users}{$location}{$target}{mode} =~ /\@/; } --- 431,435 ---- if ($_ eq "o") { if ($set eq "+") { ! $heap->{users}{$location}{$target}{mode} .= '@' unless $heap->{users}{$location}{$target}{mode} =~ /\@/; } *************** *** 450,454 **** my ($kernel, $heap, $server) = @_[KERNEL, HEAP, ARG0]; print "Lost connection to server $server.\n"; ! clear_channels(); delete $heap->{users}; $kernel->delay( connect => 60 ); --- 450,454 ---- my ($kernel, $heap, $server) = @_[KERNEL, HEAP, ARG0]; print "Lost connection to server $server.\n"; ! clear_channels($conf{name}); delete $heap->{users}; $kernel->delay( connect => 60 ); *************** *** 458,462 **** my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "Server error occurred: $error\n"; ! clear_channels(); delete $heap->{users}; $kernel->delay( connect => 60 ); --- 458,462 ---- my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "Server error occurred: $error\n"; ! clear_channels($conf{name}); delete $heap->{users}; $kernel->delay( connect => 60 ); *************** *** 466,470 **** my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "IRC client ($server): socket error occurred: $error\n"; ! clear_channels(); delete $heap->{users}; $kernel->delay( connect => 60 ); --- 466,470 ---- my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "IRC client ($server): socket error occurred: $error\n"; ! clear_channels($conf{name}); delete $heap->{users}; $kernel->delay( connect => 60 ); |
From: <rc...@us...> - 2003-11-13 05:01:30
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv27616/Client Modified Files: IRC.pm Log Message: Whitespace changes. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** IRC.pm 13 Nov 2003 03:59:05 -0000 1.12 --- IRC.pm 13 Nov 2003 05:01:27 -0000 1.13 *************** *** 397,401 **** irc_quit => sub { my ($kernel, $heap, $who, $what) = @_[KERNEL, HEAP, ARG0, ARG1]; ! my ($nick) = $who =~ /^([^!]+)/; for (keys %{$heap->{users}}) { --- 397,401 ---- irc_quit => sub { my ($kernel, $heap, $who, $what) = @_[KERNEL, HEAP, ARG0, ARG1]; ! my ($nick) = $who =~ /^([^!]+)/; for (keys %{$heap->{users}}) { *************** *** 446,450 **** # end of /who irc_366 => sub {}, ! irc_disconnected => sub { my ($kernel, $heap, $server) = @_[KERNEL, HEAP, ARG0]; --- 446,450 ---- # end of /who irc_366 => sub {}, ! irc_disconnected => sub { my ($kernel, $heap, $server) = @_[KERNEL, HEAP, ARG0]; |
From: <rc...@us...> - 2003-11-13 04:25:19
|
Update of /cvsroot/pastebot/pastebot/Server In directory sc8-pr-cvs1:/tmp/cvs-serv22246/Server Modified Files: Web.pm Log Message: Select (none) as the default channel, to prevent pasting to wrong channels. Index: Web.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Server/Web.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Web.pm 2 Nov 2003 20:16:36 -0000 1.16 --- Web.pm 13 Nov 2003 04:25:08 -0000 1.17 *************** *** 416,420 **** push @channels, grep { $_ eq $prefchan } @tmpchans; push @channels, grep { $_ ne $prefchan } @tmpchans; ! } else { @channels = @tmpchans; } --- 416,421 ---- push @channels, grep { $_ eq $prefchan } @tmpchans; push @channels, grep { $_ ne $prefchan } @tmpchans; ! } ! else { @channels = @tmpchans; } *************** *** 422,426 **** if (@channels) { @channels = map { "<option value='$_'>$_" } @channels; - $channels[0] =~ s/\'\>/\' selected>/; @channels = sort @channels; } --- 423,426 ---- |
From: <rc...@us...> - 2003-11-13 04:08:57
|
Update of /cvsroot/pastebot/pastebot/Util In directory sc8-pr-cvs1:/tmp/cvs-serv19963/Util Modified Files: Data.pm Log Message: Add an ID tag. Index: Data.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Util/Data.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Data.pm 13 Nov 2003 03:41:49 -0000 1.5 --- Data.pm 13 Nov 2003 04:08:49 -0000 1.6 *************** *** 1,3 **** --- 1,4 ---- # Data management. + # $Id$ package Util::Data; |
From: <rc...@us...> - 2003-11-13 03:59:14
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv18440/Client Modified Files: IRC.pm Log Message: Nick tracking, rotation, reclamation was not keeping track of the bot's current nickname properly. This change gets it working well enough to build the channel list, anyway. It's untested for actual nick rotation/reclamation on clashes, however. I'm pressed for time to do this more right than absolutely necessary right now. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** IRC.pm 13 Nov 2003 03:41:49 -0000 1.11 --- IRC.pm 13 Nov 2003 03:59:05 -0000 1.12 *************** *** 102,107 **** autoping => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; ! $kernel->post( $server => userhost => ! $conf{nick}->[$heap->{nick_index}] ) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; --- 102,106 ---- autoping => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; ! $kernel->post($server => userhost => $heap->{my_nick}) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; *************** *** 120,126 **** # warn "server($chosen_server) port($chosen_port)"; $kernel->post( $server => connect => { Debug => 0, ! Nick => $conf{nick}->[0], Server => $chosen_server, Port => $chosen_port, --- 119,128 ---- # warn "server($chosen_server) port($chosen_port)"; + $heap->{nick_index} = 0; + $heap->{my_nick} = $conf{nick}->[$heap->{nick_index}]; + $kernel->post( $server => connect => { Debug => 0, ! Nick => $heap->{my_nick}, Server => $chosen_server, Port => $chosen_port, *************** *** 131,136 **** ); - $heap->{nick_index} = 0; - $heap->{server_index}++; $heap->{server_index} = 0 --- 133,136 ---- *************** *** 278,282 **** $heap->{nick_index}++; - my $newnick = $conf{nick}->[$heap->{nick_index} % @{$conf{nick}}]; if ($heap->{nick_index} >= @{$conf{nick}}) { --- 278,281 ---- *************** *** 284,292 **** $kernel->delay( ison => 120 ); } ! warn "Nickclash, now trying $newnick\n"; $kernel->post( $server => nick => $newnick ); }, ! ison => sub { $_[KERNEL]->post( $server => ison => @{$conf{nick}} ); --- 283,292 ---- $kernel->delay( ison => 120 ); } ! $heap->{my_nick} = $newnick; ! warn "Nickclash, now trying $newnick\n"; $kernel->post( $server => nick => $newnick ); }, ! ison => sub { $_[KERNEL]->post( $server => ison => @{$conf{nick}} ); *************** *** 324,329 **** if (defined $conf{flags}) { ! $kernel->post( $server => mode => ! $conf{nick}->[$heap->{nick_index}] => $conf{flags} ); } $kernel->post( $server => away => $conf{away} ); --- 324,330 ---- if (defined $conf{flags}) { ! $kernel->post( ! $server => mode => $heap->{my_nick} => $conf{flags} ! ); } $kernel->post( $server => away => $conf{away} ); *************** *** 374,382 **** my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; my ($nick) = $who =~ /^([^!]+)/; ! if (lc $nick eq lc $conf{nick}->[$heap->{nick_index}]) { add_channel($where); $kernel->post( $server => who => $where ); } ! @{$heap->{users}{$where}{$nick}}{qw(ident host)} = (split /[!@]/, $who, 8)[1, 2]; }, --- 375,383 ---- my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; my ($nick) = $who =~ /^([^!]+)/; ! if (lc ($nick) eq lc($heap->{my_nick})) { add_channel($where); $kernel->post( $server => who => $where ); } ! @{$heap->{users}{$where}{$nick}}{qw(ident host)} = (split /[!@]/, $who, 8)[1, 2]; }, *************** *** 387,391 **** print "$nick was kicked from $where by $who: $reason\n"; delete $heap->{users}{$where}{$nick}; ! if (lc $nick eq lc $conf{nick}->[$heap->{nick_index}]) { remove_channel($where); delete $heap->{users}{$where}; --- 388,392 ---- print "$nick was kicked from $where by $who: $reason\n"; delete $heap->{users}{$where}{$nick}; ! if (lc($nick) eq lc($heap->{my_nick})) { remove_channel($where); delete $heap->{users}{$where}; *************** *** 408,417 **** my ($nick) = $who =~ /^([^!]+)/; delete $heap->{users}{$where}{$nick}; - }, - - irc_join => sub { - my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; - my ($nick) = $who =~ /^([^!]+)/; - add_channel($where) if lc($nick) eq lc($conf{nick}); }, --- 409,412 ---- |
From: <rc...@us...> - 2003-11-13 03:41:52
|
Update of /cvsroot/pastebot/pastebot/Util In directory sc8-pr-cvs1:/tmp/cvs-serv15903/Util Modified Files: Data.pm Log Message: TonyC noticed that the dynamic channel listing was broken. It didn't list anything until the bot side was kicked and invited back, and then it only listed the channel it was re-invited to. This patch reworks the channel management functions in Util::Data and also disambiguates lc() calls in Client::IRC. Actually, it seems that a previous patch removed irc_join. We put it back as well. Index: Data.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Util/Data.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Data.pm 31 Oct 2003 16:35:13 -0000 1.4 --- Data.pm 13 Nov 2003 03:41:49 -0000 1.5 *************** *** 31,35 **** my %paste_cache; my %ignores; # $ignores{$ircnet}{lc $channel} = [ mask, mask, ... ]; ! my @channels; # return a list of all paste ids --- 31,35 ---- my %paste_cache; my %ignores; # $ignores{$ircnet}{lc $channel} = [ mask, mask, ... ]; ! my %channels; # return a list of all paste ids *************** *** 208,217 **** sub channels { ! return @channels; } sub clear_channels { ! @channels = (); ! return if @channels; # Should never happen return 1; } --- 208,217 ---- sub channels { ! return sort keys %channels; } sub clear_channels { ! %channels = (); ! return if keys %channels; # Should never happen return 1; } *************** *** 219,234 **** sub add_channel { my ($channel) = @_; ! $channel = lc $channel; ! return if grep $_ eq $channel, @channels; ! return push @channels, $channel; } sub remove_channel { my ($channel) = @_; ! $channel = lc $channel; ! my $found = 0; ! @channels = grep { $_ eq $channel ? do { $found++; 0; } : 1 } @channels; ! return if not $found; ! return $found; } --- 219,230 ---- sub add_channel { my ($channel) = @_; ! $channel = lc($channel); ! $channels{$channel} = 1; } sub remove_channel { my ($channel) = @_; ! $channel = lc($channel); ! delete $channels{$channel}; # returns automatically } |
From: <rc...@us...> - 2003-11-13 03:41:52
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv15903/Client Modified Files: IRC.pm Log Message: TonyC noticed that the dynamic channel listing was broken. It didn't list anything until the bot side was kicked and invited back, and then it only listed the channel it was re-invited to. This patch reworks the channel management functions in Util::Data and also disambiguates lc() calls in Client::IRC. Actually, it seems that a previous patch removed irc_join. We put it back as well. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IRC.pm 1 Nov 2003 16:27:01 -0000 1.10 --- IRC.pm 13 Nov 2003 03:41:49 -0000 1.11 *************** *** 410,413 **** --- 410,419 ---- }, + irc_join => sub { + my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; + my ($nick) = $who =~ /^([^!]+)/; + add_channel($where) if lc($nick) eq lc($conf{nick}); + }, + # who reply irc_352 => sub { *************** *** 415,419 **** my @reply = split " ", $what, 8; ! @{$heap->{users}{$reply[0]}{$reply[4]}}{qw(ident host mode real)} = ($reply[1], $reply[2], $reply[5], $reply[7]); }, --- 421,425 ---- my @reply = split " ", $what, 8; ! @{$heap->{users}{$reply[0]}{$reply[4]}}{qw(ident host mode real)} = ($reply[1], $reply[2], $reply[5], $reply[7]); }, |
From: <rc...@us...> - 2003-11-13 02:44:56
|
Update of /cvsroot/pastebot/pastebot In directory sc8-pr-cvs1:/tmp/cvs-serv5519 Modified Files: MANIFEST Log Message: Remove SQLite. Index: MANIFEST =================================================================== RCS file: /cvsroot/pastebot/pastebot/MANIFEST,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MANIFEST 31 Oct 2003 16:49:21 -0000 1.2 --- MANIFEST 13 Nov 2003 02:44:35 -0000 1.3 *************** *** 1,5 **** COPYRIGHT Client/IRC.pm - Data/SQLite.pm MANIFEST MANIFEST.SKIP --- 1,4 ---- |
From: <ju...@us...> - 2003-11-02 20:16:41
|
Update of /cvsroot/pastebot/pastebot/Util In directory sc8-pr-cvs1:/tmp/cvs-serv15749/Util Modified Files: Web.pm Log Message: Added cookie support and HTML <label>s Index: Web.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Util/Web.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Web.pm 4 Jun 2003 04:06:03 -0000 1.4 --- Web.pm 2 Nov 2003 20:16:38 -0000 1.5 *************** *** 9,19 **** use vars qw(@ISA @EXPORT); use Text::Template; use Exporter; @ISA = qw(Exporter); ! @EXPORT = qw( url_decode url_encode parse_content static_response dump_content dump_query_as_response base64_decode ! html_encode is_true ); --- 9,20 ---- use vars qw(@ISA @EXPORT); + use CGI::Cookie; use Text::Template; use Exporter; @ISA = qw(Exporter); ! @EXPORT = qw( url_decode url_encode parse_content parse_cookie static_response dump_content dump_query_as_response base64_decode ! html_encode is_true cookie ); *************** *** 38,41 **** --- 39,56 ---- } + # Return a cookie string for a Set-Cookie header. The request argument is + # used to figure out domain. + sub cookie { + my ($name, $value, $request) = @_; + + return CGI::Cookie->new( + -name => $name, + -value => $value, + -expires => '+36M', + -domain => (split /:/, $request->headers->header('Host'))[0], + -path => '/', + )->as_string; + } + # Decode url-encoded data. This code was shamelessly stolen from # Lincoln Stein's CGI.pm module. Translate plusses to spaces, and *************** *** 107,110 **** --- 122,134 ---- } + # Parse a cookie string (found usually in the Cookie: header), returning a + # hashref containing cookies values, not CGI::Cookie objects. + sub parse_cookie { + my ($cookie) = @_; + + return {} if not defined $cookie; + return { map url_decode($_), map /([^=]+)=?(.*)/s, split /; ?/, $cookie }; + } + # Generate a static response from a file. sub static_response { |
From: <ju...@us...> - 2003-11-02 20:16:41
|
Update of /cvsroot/pastebot/pastebot/templates In directory sc8-pr-cvs1:/tmp/cvs-serv15749/templates Modified Files: paste-lookup.html Log Message: Added cookie support and HTML <label>s Index: paste-lookup.html =================================================================== RCS file: /cvsroot/pastebot/pastebot/templates/paste-lookup.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** paste-lookup.html 30 Oct 2003 17:38:55 -0000 1.7 --- paste-lookup.html 2 Nov 2003 20:16:38 -0000 1.8 *************** *** 29,38 **** <a name="format"></a> <form method='get' action='[% $paste_id %]'> ! <input type='checkbox' name='tx' [% $tx %]> plain text (suitable for cut and paste, <font color="red">overrides all</font>)<br><br> ! <input type='checkbox' name='wr' [% $wr %]> word wrap (disables pre-formatted text wrapper)<br> ! <input type='checkbox' name='ln' [% $ln %]> line numbers<br><br> perl stuff: (might be helpful for others but not perfect)<br> ! <input type='checkbox' name='tidy' [% $tidy %]> tidy up a bit<br> ! <input type='checkbox' name='hl' [% $hl %]> syntax highlight<br><br> <input type='submit' name='submit' value='Format it!'> </form> --- 29,57 ---- <a name="format"></a> <form method='get' action='[% $paste_id %]'> ! <input type='checkbox' id='tx' name='tx' [% $tx %]> ! <label for='tx'> ! plain text (suitable for cut and paste, <font color="red">overrides all</font>) ! </label><br><br> ! <input type='checkbox' id='wr' name='wr' [% $wr %]> ! <label for='wr'> ! word wrap (disables pre-formatted text wrapper) ! </label><br> ! <input type='checkbox' id='ln' name='ln' [% $ln %]> ! <label for='ln'> ! line numbers ! </label><br><br> perl stuff: (might be helpful for others but not perfect)<br> ! <input type='checkbox' id='tidy' name='tidy' [% $tidy %]> ! <label for='tidy'> ! tidy up a bit ! </label><br> ! <input type='checkbox' id='hl' name='hl' [% $hl %]> ! <label for='hl'> ! syntax highlight ! </label><br><br> ! <input type='checkbox' id='store' name='store'> ! <label for='store'> ! store these preferences in a semi-permanent cookie ! </label> <input type='submit' name='submit' value='Format it!'> </form> |
From: <ju...@us...> - 2003-11-02 20:16:41
|
Update of /cvsroot/pastebot/pastebot/Server In directory sc8-pr-cvs1:/tmp/cvs-serv15749/Server Modified Files: Web.pm Log Message: Added cookie support and HTML <label>s Index: Web.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Server/Web.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Web.pm 30 Oct 2003 17:38:55 -0000 1.15 --- Web.pm 2 Nov 2003 20:16:36 -0000 1.16 *************** *** 326,338 **** if (defined $paste) { ! my $query = parse_content($params); ### Make the paste pretty. ! my $ln = is_true($query->{ln}); ! my $tidy = is_true($query->{tidy}); ! my $hl = is_true($query->{hl}); ! my $tx = is_true($query->{tx}); ! my $wr = is_true($query->{wr}); my $variants = [ --- 326,345 ---- if (defined $paste) { ! my $cookie = parse_cookie($request->headers->header('Cookie')); ! my $query = parse_content($params); ### Make the paste pretty. ! my $ln = exists $query ->{ln} ? is_true($query ->{ln}) : ! exists $cookie->{ln} ? is_true($cookie->{ln}) : 0; ! my $tidy = exists $query ->{tidy} ? is_true($query ->{tidy}) : ! exists $cookie->{tidy} ? is_true($cookie->{tidy}) : 0; ! my $hl = exists $query ->{hl} ? is_true($query ->{hl}) : ! exists $cookie->{hl} ? is_true($cookie->{hl}) : 0; ! my $tx = exists $query ->{tx} ? is_true($query ->{tx}) : ! exists $cookie->{tx} ? is_true($cookie->{tx}) : 0; ! my $wr = exists $query ->{wr} ? is_true($query ->{wr}) : ! exists $cookie->{wr} ? is_true($cookie->{wr}) : 0; ! my $store = is_true($query->{store}); my $variants = [ *************** *** 369,372 **** --- 376,385 ---- } ); + if ($store) { + $response->push_header('Set-Cookie'=>cookie(tidy=>$tidy, $request)); + $response->push_header('Set-Cookie' => cookie(hl => $hl, $request)); + $response->push_header('Set-Cookie' => cookie(wr => $wr, $request)); + $response->push_header('Set-Cookie' => cookie(ln => $ln, $request)); + } } |
From: <ave...@us...> - 2003-11-01 16:27:04
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv5417/Client Modified Files: IRC.pm Log Message: Minor fixing. remove /whois on commands Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** IRC.pm 1 Nov 2003 14:49:30 -0000 1.9 --- IRC.pm 1 Nov 2003 16:27:01 -0000 1.10 *************** *** 168,179 **** return; } ! ! # save it for later ! push(@{$heap->{work}{lc $nick}}, ! [ ignore => $mask => $channels ]); ! ! # only for chanops - find out where they are ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); } elsif ($msg =~ /^\s*ignores\s/) { --- 168,205 ---- return; } ! my @igchans; ! if ($channels) { ! @igchans = split ',', lc $channels; ! } ! else { ! @igchans = map lc, channels(); ! } ! # only the channels the user is an operator on ! @igchans = grep {exists $heap->{users}{$_}{$nick}{mode} and ! $heap->{users}{$_}{$nick}{mode} =~ /@/} @igchans; ! @igchans or return; ! if ($mask eq '-') { ! for my $chan (@igchans) { ! clear_channel_ignores($conf{name}, $chan); ! print "Nick '$nick' deleted all ignores on $chan\n"; ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed all ignores on @igchans"); ! } ! elsif ($mask =~ /^-(.*)$/) { ! my $clearmask = $1; ! for my $chan (@igchans) { ! clear_ignore($conf{name}, $chan, $clearmask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed ignore $clearmask on @igchans"); ! } ! else { ! for my $chan (@igchans) { ! set_ignore($conf{name}, $chan, $mask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Added ignore mask $mask on @igchans"); ! } } elsif ($msg =~ /^\s*ignores\s/) { *************** *** 201,210 **** return; } ! # save it for later ! push(@{$heap->{work}{lc $nick}}, [ delete => $1 ]); ! ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); } elsif ($msg =~ /^\s*uptime\s*$/) { --- 227,251 ---- return; } + my $pasteid = $1; + my $paste_chan = fetch_paste_channel($pasteid); ! if (defined $paste_chan) { ! if ($heap->{users}{$paste_chan}{$nick}{mode} =~ /@/) { ! delete_paste($conf{name}, $paste_chan, $pasteid, $nick) ! or print "It didn't delete!\n"; ! $kernel->post( $server => privmsg => $nick => ! "Deleted paste $pasteid") ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "Paste $pasteid was sent to $paste_chan - " . ! "you aren't a channel operator on $paste_chan" ! ) ! } ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "No such paste") ! } } elsif ($msg =~ /^\s*uptime\s*$/) { *************** *** 224,304 **** }, - irc_319 => sub { - my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG1]; - - my ($nick, $channels) = split ' ', $msg, 2; - $channels =~ s/^://; - my @channels = grep /^@/, split ' ', lc $channels; - s/^@// for @channels; - my %channels = map { $_, $_ } @channels; - - my $work = delete $heap->{work}{lc $nick}; - for my $job (@$work) { - my $action = shift @$job; - if ($action eq 'ignore') { - my ($mask, $channels) = @$job; - my @igchans; - if ($channels) { - @igchans = split ',', lc $channels; - } - else { - @igchans = map "#\L$_", @{$conf{channel}}; - } - # only the channels the user is an operator on - @igchans = grep $channels{$_}, @igchans; - @igchans or next; - if ($mask eq '-') { - for my $chan (@igchans) { - clear_channel_ignores($conf{name}, $chan); - print "Nick '$nick' deleted all ignores on $chan\n"; - } - $kernel->post( $server => privmsg => $nick => - "Removed all ignores on @igchans"); - } - elsif ($mask =~ /^-(.*)$/) { - my $mask = $1; - for my $chan (@igchans) { - clear_ignore($conf{name}, $chan, $mask); - } - $kernel->post( $server => privmsg => $nick => - "Removed ignore $mask on @igchans"); - } - else { - for my $chan (@igchans) { - set_ignore($conf{name}, $chan, $mask); - } - $kernel->post( $server => privmsg => $nick => - "Added ignore mask $mask on @igchans"); - } - } - elsif ($action eq 'delete') { - my $paste_chan = fetch_paste_channel($job->[0]); - - if (defined $paste_chan) { - if ($channels{lc $paste_chan}) { - delete_paste($conf{name}, $paste_chan, $job->[0], $nick) - or print "It didn't delete!\n"; - $kernel->post( $server => privmsg => $nick => - "Deleted paste $job->[0]") - } - else { - $kernel->post( $server => privmsg => $nick => - "Paste $job->[0] was sent to $paste_chan - " . - "you aren't a channel operator on $paste_chan" - ) - } - } - else { - $kernel->post( $server => privmsg => $nick => - "No such paste") - } - } - else { - print "Unknown action $action\n"; - } - } - - }, - # negative on /whois irc_401 => sub { --- 265,268 ---- *************** *** 513,517 **** $heap->{seen_traffic} = 1; ! # Do something with input here? }, --- 477,481 ---- $heap->{seen_traffic} = 1; ! # Do something with input here? }, |
From: <ave...@us...> - 2003-11-01 16:27:04
|
Update of /cvsroot/pastebot/pastebot In directory sc8-pr-cvs1:/tmp/cvs-serv5417 Modified Files: TODO Log Message: Minor fixing. remove /whois on commands Index: TODO =================================================================== RCS file: /cvsroot/pastebot/pastebot/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 31 Oct 2003 16:35:13 -0000 1.8 --- TODO 1 Nov 2003 16:27:01 -0000 1.9 *************** *** 60,70 **** and channel where the bot heard the trigger. - ---------------------------- - Nickname dispute resolution. - ---------------------------- - - If the chosen nickname is taken, pick another. When the desired - nickname becomes available again, reclaim it. - ----------------- Time-limited keys --- 60,63 ---- *************** *** 266,275 **** Optionally have the daemon run as a specific user. - - *** User/mask tracking per channel. - - Have the bot grab a list of /names when it joins a channel. It then - watches as users join, part, quit, or are kicked and manages that - list. *** Make databases persistent. --- 259,262 ---- |
From: <ave...@us...> - 2003-11-01 14:49:34
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv21319/Client Modified Files: IRC.pm Log Message: User tracking. Grabs /who, monitors changes. also +o -o. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IRC.pm 31 Oct 2003 23:23:50 -0000 1.8 --- IRC.pm 1 Nov 2003 14:49:30 -0000 1.9 *************** *** 410,415 **** my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; my ($nick) = $who =~ /^([^!]+)/; ! add_channel($where) ! if lc $nick eq lc $conf{nick}->[$heap->{nick_index}]; }, --- 410,419 ---- my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; my ($nick) = $who =~ /^([^!]+)/; ! if (lc $nick eq lc $conf{nick}->[$heap->{nick_index}]) { ! add_channel($where); ! $kernel->post( $server => who => $where ); ! } ! @{$heap->{users}{$where}{$nick}}{qw(ident host)} = ! (split /[!@]/, $who, 8)[1, 2]; }, *************** *** 418,444 **** = @_[KERNEL, HEAP, ARG0..ARG3]; print "$nick was kicked from $where by $who: $reason\n"; ! remove_channel($where) ! if lc $nick eq lc $conf{nick}->[$heap->{nick_index}]; # $kernel->delay( join => 15 => $where ); }, irc_disconnected => sub { ! my ($kernel, $server) = @_[KERNEL, ARG0]; print "Lost connection to server $server.\n"; clear_channels(); $kernel->delay( connect => 60 ); }, irc_error => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; print "Server error occurred: $error\n"; clear_channels(); $kernel->delay( connect => 60 ); }, irc_socketerr => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; print "IRC client ($server): socket error occurred: $error\n"; clear_channels(); $kernel->delay( connect => 60 ); }, --- 422,506 ---- = @_[KERNEL, HEAP, ARG0..ARG3]; print "$nick was kicked from $where by $who: $reason\n"; ! delete $heap->{users}{$where}{$nick}; ! if (lc $nick eq lc $conf{nick}->[$heap->{nick_index}]) { ! remove_channel($where); ! delete $heap->{users}{$where}; ! } # $kernel->delay( join => 15 => $where ); }, + irc_quit => sub { + my ($kernel, $heap, $who, $what) = @_[KERNEL, HEAP, ARG0, ARG1]; + + my ($nick) = $who =~ /^([^!]+)/; + for (keys %{$heap->{users}}) { + delete $heap->{users}{$_}{$nick}; + } + }, + + irc_part => sub { + my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; + + my ($nick) = $who =~ /^([^!]+)/; + delete $heap->{users}{$where}{$nick}; + }, + + # who reply + irc_352 => sub { + my ($kernel, $heap, $what) = @_[KERNEL, HEAP, ARG1]; + + my @reply = split " ", $what, 8; + @{$heap->{users}{$reply[0]}{$reply[4]}}{qw(ident host mode real)} = + ($reply[1], $reply[2], $reply[5], $reply[7]); + }, + + irc_mode => sub { + my ($kernel, $heap, $issuer, $location, $modestr, @targets) + = @_[KERNEL, HEAP, ARG0..$#_]; + + my $set = "+"; + for (split //, $modestr) { + $set = $_ if ($_ eq "-" or $_ eq "+"); + if (/[bklovehI]/) { # mode has argument + my $target = shift @targets; + if ($_ eq "o") { + if ($set eq "+") { + $heap->{users}{$location}{$target}{mode} .= "@" + unless $heap->{users}{$location}{$target}{mode} =~ /\@/; + } + else { + $heap->{users}{$location}{$target}{mode} =~ s/\@//; + } + } + } + } + }, + + # end of /names + irc_315 => sub {}, + # end of /who + irc_366 => sub {}, + irc_disconnected => sub { ! my ($kernel, $heap, $server) = @_[KERNEL, HEAP, ARG0]; print "Lost connection to server $server.\n"; clear_channels(); + delete $heap->{users}; $kernel->delay( connect => 60 ); }, irc_error => sub { ! my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "Server error occurred: $error\n"; clear_channels(); + delete $heap->{users}; $kernel->delay( connect => 60 ); }, irc_socketerr => sub { ! my ($kernel, $heap, $error) = @_[KERNEL, HEAP, ARG0]; print "IRC client ($server): socket error occurred: $error\n"; clear_channels(); + delete $heap->{users}; $kernel->delay( connect => 60 ); }, *************** *** 451,455 **** $heap->{seen_traffic} = 1; ! # Do something with input here? }, --- 513,517 ---- $heap->{seen_traffic} = 1; ! # Do something with input here? }, |
From: <ave...@us...> - 2003-10-31 23:23:54
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv25561/Client Modified Files: IRC.pm Log Message: Damn. Typofix here Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IRC.pm 31 Oct 2003 22:41:56 -0000 1.7 --- IRC.pm 31 Oct 2003 23:23:50 -0000 1.8 *************** *** 103,107 **** my ($kernel, $heap) = @_[KERNEL, HEAP]; $kernel->post( $server => userhost => ! $conf{nicks}->[$heap->{nick_index}] ) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; --- 103,107 ---- my ($kernel, $heap) = @_[KERNEL, HEAP]; $kernel->post( $server => userhost => ! $conf{nick}->[$heap->{nick_index}] ) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; *************** *** 122,126 **** $kernel->post( $server => connect => { Debug => 0, ! Nick => $conf{nicks}->[0], Server => $chosen_server, Port => $chosen_port, --- 122,126 ---- $kernel->post( $server => connect => { Debug => 0, ! Nick => $conf{nick}->[0], Server => $chosen_server, Port => $chosen_port, *************** *** 315,321 **** $heap->{nick_index}++; ! my $newnick = $conf{nicks}->[$heap->{nick_index} % @{$conf{nicks}}]; ! if ($heap->{nick_index} >= @{$conf{nicks}}) { ! $newnick .= $heap->{nick_index} - @{$conf{nicks}}; $kernel->delay( ison => 120 ); } --- 315,321 ---- $heap->{nick_index}++; ! my $newnick = $conf{nick}->[$heap->{nick_index} % @{$conf{nick}}]; ! if ($heap->{nick_index} >= @{$conf{nick}}) { ! $newnick .= $heap->{nick_index} - @{$conf{nick}}; $kernel->delay( ison => 120 ); } *************** *** 326,330 **** ison => sub { ! $_[KERNEL]->post( $server => ison => @{$conf{nicks}} ); }, --- 326,330 ---- ison => sub { ! $_[KERNEL]->post( $server => ison => @{$conf{nick}} ); }, *************** *** 334,338 **** my @nicklist = split " ", lc $nicklist; ! for my $totry (@{$conf{nicks}}) { unless (grep $_ eq lc $totry, @nicklist) { $kernel->post( $server => nick => $totry ); --- 334,338 ---- my @nicklist = split " ", lc $nicklist; ! for my $totry (@{$conf{nick}}) { unless (grep $_ eq lc $totry, @nicklist) { $kernel->post( $server => nick => $totry ); *************** *** 361,365 **** if (defined $conf{flags}) { $kernel->post( $server => mode => ! $conf{nicks}->[$heap->{nick_index}] => $conf{flags} ); } $kernel->post( $server => away => $conf{away} ); --- 361,365 ---- if (defined $conf{flags}) { $kernel->post( $server => mode => ! $conf{nick}->[$heap->{nick_index}] => $conf{flags} ); } $kernel->post( $server => away => $conf{away} ); *************** *** 411,415 **** my ($nick) = $who =~ /^([^!]+)/; add_channel($where) ! if lc $nick eq lc $conf{nicks}->[$heap->{nick_index}]; }, --- 411,415 ---- my ($nick) = $who =~ /^([^!]+)/; add_channel($where) ! if lc $nick eq lc $conf{nick}->[$heap->{nick_index}]; }, *************** *** 419,423 **** print "$nick was kicked from $where by $who: $reason\n"; remove_channel($where) ! if lc $nick eq lc $conf{nicks}->[$heap->{nick_index}]; # $kernel->delay( join => 15 => $where ); }, --- 419,423 ---- print "$nick was kicked from $where by $who: $reason\n"; remove_channel($where) ! if lc $nick eq lc $conf{nick}->[$heap->{nick_index}]; # $kernel->delay( join => 15 => $where ); }, |
From: <ave...@us...> - 2003-10-31 22:41:59
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv18296/Client Modified Files: IRC.pm Log Message: Takes a list of nicknames now. Will try auto-reclaim if all in list are taken. Also indent was in different styles over the file, recommending diff -b. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IRC.pm 31 Oct 2003 19:52:01 -0000 1.6 --- IRC.pm 31 Oct 2003 22:41:56 -0000 1.7 *************** *** 102,106 **** autoping => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; ! $kernel->post( $server => userhost => $conf{nick} ) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; --- 102,107 ---- autoping => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; ! $kernel->post( $server => userhost => ! $conf{nicks}->[$heap->{nick_index}] ) unless $heap->{seen_traffic}; $heap->{seen_traffic} = 0; *************** *** 121,125 **** $kernel->post( $server => connect => { Debug => 0, ! Nick => $conf{nick}, Server => $chosen_server, Port => $chosen_port, --- 122,126 ---- $kernel->post( $server => connect => { Debug => 0, ! Nick => $conf{nicks}->[0], Server => $chosen_server, Port => $chosen_port, *************** *** 130,418 **** ); $heap->{server_index}++; $heap->{server_index} = 0 if $heap->{server_index} >= @{$conf{server}}; ! }, ! join => sub { ! my ($kernel, $channel) = @_[KERNEL, ARG0]; ! $kernel->post( $server => join => $channel ); ! }, ! irc_msg => sub { ! my ($kernel, $heap, $sender, $msg) = @_[KERNEL, HEAP, ARG0, ARG2]; ! my ($nick) = $sender =~ /^([^!]+)/; ! print "Message $msg from $nick\n"; ! if ($msg =~ /^\s*help(?:\s+(\w+))?\s*$/) { ! my $what = $1 || 'help'; ! if ($helptext{$what}) { ! $kernel->post( $server => privmsg => $nick, ! $helptext{$what}); ! } ! } ! elsif ($msg =~ /^\s*ignore\s/) { ! unless ($msg =~ /^\s*ignore\s+(\S+)(?:\s+(\S+))?\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: ignore <wildcard> [<channels>]"); ! return; ! } ! my ($mask, $channels) = ($1, $2); ! unless ($mask =~ /^-?\d+(\.(\*|\d+)){3}$/ ! || $mask eq '-') { ! $kernel->post($server => privmsg => $nick, ! "Invalid wildcard. Try: help wildcards"); ! return; ! } ! # save it for later ! push(@{$heap->{work}{lc $nick}}, ! [ ignore => $mask => $channels ]); ! # only for chanops - find out where they are ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); ! } ! elsif ($msg =~ /^\s*ignores\s/) { ! unless ($msg =~ /^\s*ignores\s+(\#\S+)\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: ignores <channel>"); ! return; ! } ! my $channel = lc $1; ! my @masks = get_ignores($conf{name}, $channel); ! unless (@masks) { ! $kernel->post( $server => privmsg => $nick, ! "No ignores on $channel" ); ! return; ! } ! my $text = join " ", @masks; ! substr($text, 100) = '...' unless length $text < 100; ! $kernel->post( $server=> privmsg => $nick, ! "Ignores on $channel are: $text"); ! } ! elsif ($msg =~ /^\s*delete\s/) { ! unless ($msg =~ /^\s*delete\s+(\d+)\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: delete <pasteid>"); ! return; ! } ! # save it for later ! push(@{$heap->{work}{lc $nick}}, [ delete => $1 ]); ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); ! } ! elsif ($msg =~ /^\s*uptime\s*$/) { ! my ($user_time, $system_time) = (times())[0,1]; ! my $wall_time = (time() - $^T) || 1; ! my $load_average = ! sprintf("%.4f", ($user_time+$system_time) / $wall_time); ! $kernel->post ! ( $server => privmsg => $nick, ! "I was started on " . scalar(gmtime($^T)) . " GMT. " . ! "I've been active for " . format_elapsed($wall_time, 2) . ". " . ! sprintf( "I have used about %.2f%% of a CPU during my lifespan.", ! (($user_time+$system_time)/$wall_time) * 100 ! ) ! ); ! } ! }, ! irc_319 => sub { ! my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG1]; ! my ($nick, $channels) = split ' ', $msg, 2; ! $channels =~ s/^://; ! my @channels = grep /^@/, split ' ', lc $channels; ! s/^@// for @channels; ! my %channels = map { $_, $_ } @channels; ! my $work = delete $heap->{work}{lc $nick}; ! for my $job (@$work) { ! my $action = shift @$job; ! if ($action eq 'ignore') { ! my ($mask, $channels) = @$job; ! my @igchans; ! if ($channels) { ! @igchans = split ',', lc $channels; ! } ! else { ! @igchans = map "#\L$_", @{$conf{channel}}; ! } ! # only the channels the user is an operator on ! @igchans = grep $channels{$_}, @igchans; ! @igchans or next; ! if ($mask eq '-') { ! for my $chan (@igchans) { ! clear_channel_ignores($conf{name}, $chan); ! print "Nick '$nick' deleted all ignores on $chan\n"; ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed all ignores on @igchans"); ! } ! elsif ($mask =~ /^-(.*)$/) { ! my $mask = $1; ! for my $chan (@igchans) { ! clear_ignore($conf{name}, $chan, $mask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed ignore $mask on @igchans"); ! } ! else { ! for my $chan (@igchans) { ! set_ignore($conf{name}, $chan, $mask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Added ignore mask $mask on @igchans"); ! } ! } ! elsif ($action eq 'delete') { ! my $paste_chan = fetch_paste_channel($job->[0]); ! if (defined $paste_chan) { ! if ($channels{lc $paste_chan}) { ! delete_paste($conf{name}, $paste_chan, $job->[0], $nick) ! or print "It didn't delete!\n"; ! $kernel->post( $server => privmsg => $nick => ! "Deleted paste $job->[0]") ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "Paste $job->[0] was sent to $paste_chan - " . ! "you aren't a channel operator on $paste_chan" ! ) ! } ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "No such paste") ! } ! } ! else { ! print "Unknown action $action\n"; ! } ! } ! }, ! # negative on /whois ! irc_401 => sub { ! my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG1]; ! my ($nick) = split ' ', $msg; ! delete $heap->{work}{lc $nick}; ! }, ! _stop => sub { ! my $kernel = $_[KERNEL]; ! $kernel->post( $server => quit => $conf{quit} ); ! }, ! _default => sub { ! my ($state, $event, $args, $heap) = @_[STATE, ARG0, ARG1, HEAP]; ! $args ||= [ ]; ! print "default $state = $event (@$args)\n"; ! $heap->{seen_traffic} = 1; ! return 0; ! }, ! irc_001 => sub { ! my ($kernel, $heap) = @_[KERNEL, HEAP]; ! if (defined $conf{flags}) { ! $kernel->post( $server => mode => $conf{nick} => $conf{flags} ); ! } ! $kernel->post( $server => away => $conf{away} ); ! foreach my $channel (@{$conf{channel}}) { ! $kernel->yield( join => "\#$channel" ); ! } ! $heap->{server_index} = 0; ! }, ! announce => sub { ! my ($kernel, $heap, $channel, $message) = @_[KERNEL, HEAP, ARG0, ARG1]; ! $kernel->post( $server => privmsg => $channel => $message ); ! }, ! irc_ctcp_version => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp version from $who\n"; ! $kernel->post( $server => ctcpreply => $who, "VERSION $conf{cver}" ); ! }, ! irc_ctcp_clientinfo => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp clientinfo from $who\n"; ! $kernel->post( $server => ctcpreply => ! $who, "CLIENTINFO $conf{ccinfo}" ! ); ! }, ! irc_ctcp_userinfo => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp userinfo from $who\n"; ! $kernel->post( $server => ctcpreply => ! $who, "USERINFO $conf{cuinfo}" ! ); ! }, ! irc_invite => sub { ! my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; ! $kernel->yield( join => $where ); ! }, ! irc_join => sub { ! my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; ! my ($nick) = $who =~ /^([^!]+)/; ! add_channel($where) if lc $nick eq lc $conf{nick}; ! }, ! irc_kick => sub { ! my ($kernel, $who, $where, $nick, $reason) = @_[KERNEL, ARG0..ARG3]; ! print "$who was kicked from $where: $reason\n"; ! remove_channel($where) if lc $nick eq lc $conf{nick}; ! # $kernel->delay( join => 15 => $where ); ! }, ! irc_disconnected => sub { ! my ($kernel, $server) = @_[KERNEL, ARG0]; ! print "Lost connection to server $server.\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! irc_error => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; ! print "Server error occurred: $error\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! irc_socketerr => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; ! print "IRC client ($server): socket error occurred: $error\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! irc_public => sub { ! my ($kernel, $heap, $who, $where, $msg) = @_[KERNEL, HEAP, ARG0..ARG2]; ! $who = (split /!/, $who)[0]; ! $where = $where->[0]; ! print "<$who:$where> $msg\n"; ! $heap->{seen_traffic} = 1; ! # Do something with input here? }, ! }, ! ); } --- 131,459 ---- ); + $heap->{nick_index} = 0; + $heap->{server_index}++; $heap->{server_index} = 0 if $heap->{server_index} >= @{$conf{server}}; ! }, ! join => sub { ! my ($kernel, $channel) = @_[KERNEL, ARG0]; ! $kernel->post( $server => join => $channel ); ! }, ! irc_msg => sub { ! my ($kernel, $heap, $sender, $msg) = @_[KERNEL, HEAP, ARG0, ARG2]; ! my ($nick) = $sender =~ /^([^!]+)/; ! print "Message $msg from $nick\n"; ! if ($msg =~ /^\s*help(?:\s+(\w+))?\s*$/) { ! my $what = $1 || 'help'; ! if ($helptext{$what}) { ! $kernel->post( $server => privmsg => $nick, ! $helptext{$what}); ! } ! } ! elsif ($msg =~ /^\s*ignore\s/) { ! unless ($msg =~ /^\s*ignore\s+(\S+)(?:\s+(\S+))?\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: ignore <wildcard> [<channels>]"); ! return; ! } ! my ($mask, $channels) = ($1, $2); ! unless ($mask =~ /^-?\d+(\.(\*|\d+)){3}$/ ! || $mask eq '-') { ! $kernel->post($server => privmsg => $nick, ! "Invalid wildcard. Try: help wildcards"); ! return; ! } ! # save it for later ! push(@{$heap->{work}{lc $nick}}, ! [ ignore => $mask => $channels ]); ! # only for chanops - find out where they are ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); ! } ! elsif ($msg =~ /^\s*ignores\s/) { ! unless ($msg =~ /^\s*ignores\s+(\#\S+)\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: ignores <channel>"); ! return; ! } ! my $channel = lc $1; ! my @masks = get_ignores($conf{name}, $channel); ! unless (@masks) { ! $kernel->post( $server => privmsg => $nick, ! "No ignores on $channel" ); ! return; ! } ! my $text = join " ", @masks; ! substr($text, 100) = '...' unless length $text < 100; ! $kernel->post( $server=> privmsg => $nick, ! "Ignores on $channel are: $text"); ! } ! elsif ($msg =~ /^\s*delete\s/) { ! unless ($msg =~ /^\s*delete\s+(\d+)\s*$/) { ! $kernel->post( $server => privmsg => $nick, ! "Usage: delete <pasteid>"); ! return; ! } ! # save it for later ! push(@{$heap->{work}{lc $nick}}, [ delete => $1 ]); ! @{$heap->{work}{lc $nick}} > 1 ! or $kernel->post($server => whois => $nick ); ! } ! elsif ($msg =~ /^\s*uptime\s*$/) { ! my ($user_time, $system_time) = (times())[0,1]; ! my $wall_time = (time() - $^T) || 1; ! my $load_average = ! sprintf("%.4f", ($user_time+$system_time) / $wall_time); ! $kernel->post ! ( $server => privmsg => $nick, ! "I was started on " . scalar(gmtime($^T)) . " GMT. " . ! "I've been active for " . format_elapsed($wall_time, 2) . ". " . ! sprintf( "I have used about %.2f%% of a CPU during my lifespan.", ! (($user_time+$system_time)/$wall_time) * 100 ! ) ! ); ! } ! }, ! irc_319 => sub { ! my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG1]; ! my ($nick, $channels) = split ' ', $msg, 2; ! $channels =~ s/^://; ! my @channels = grep /^@/, split ' ', lc $channels; ! s/^@// for @channels; ! my %channels = map { $_, $_ } @channels; ! my $work = delete $heap->{work}{lc $nick}; ! for my $job (@$work) { ! my $action = shift @$job; ! if ($action eq 'ignore') { ! my ($mask, $channels) = @$job; ! my @igchans; ! if ($channels) { ! @igchans = split ',', lc $channels; ! } ! else { ! @igchans = map "#\L$_", @{$conf{channel}}; ! } ! # only the channels the user is an operator on ! @igchans = grep $channels{$_}, @igchans; ! @igchans or next; ! if ($mask eq '-') { ! for my $chan (@igchans) { ! clear_channel_ignores($conf{name}, $chan); ! print "Nick '$nick' deleted all ignores on $chan\n"; ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed all ignores on @igchans"); ! } ! elsif ($mask =~ /^-(.*)$/) { ! my $mask = $1; ! for my $chan (@igchans) { ! clear_ignore($conf{name}, $chan, $mask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Removed ignore $mask on @igchans"); ! } ! else { ! for my $chan (@igchans) { ! set_ignore($conf{name}, $chan, $mask); ! } ! $kernel->post( $server => privmsg => $nick => ! "Added ignore mask $mask on @igchans"); ! } ! } ! elsif ($action eq 'delete') { ! my $paste_chan = fetch_paste_channel($job->[0]); ! if (defined $paste_chan) { ! if ($channels{lc $paste_chan}) { ! delete_paste($conf{name}, $paste_chan, $job->[0], $nick) ! or print "It didn't delete!\n"; ! $kernel->post( $server => privmsg => $nick => ! "Deleted paste $job->[0]") ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "Paste $job->[0] was sent to $paste_chan - " . ! "you aren't a channel operator on $paste_chan" ! ) ! } ! } ! else { ! $kernel->post( $server => privmsg => $nick => ! "No such paste") ! } ! } ! else { ! print "Unknown action $action\n"; ! } ! } ! }, ! # negative on /whois ! irc_401 => sub { ! my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG1]; ! my ($nick) = split ' ', $msg; ! delete $heap->{work}{lc $nick}; ! }, ! # Nick is in use ! irc_433 => sub { ! my ($kernel, $heap) = @_[KERNEL, HEAP]; ! $heap->{nick_index}++; ! ! my $newnick = $conf{nicks}->[$heap->{nick_index} % @{$conf{nicks}}]; ! if ($heap->{nick_index} >= @{$conf{nicks}}) { ! $newnick .= $heap->{nick_index} - @{$conf{nicks}}; ! $kernel->delay( ison => 120 ); ! } ! ! warn "Nickclash, now trying $newnick\n"; ! $kernel->post( $server => nick => $newnick ); ! }, ! ! ison => sub { ! $_[KERNEL]->post( $server => ison => @{$conf{nicks}} ); ! }, ! # ISON reply ! irc_303 => sub { ! my ($kernel, $heap, $nicklist) = @_[KERNEL, HEAP, ARG1]; ! my @nicklist = split " ", lc $nicklist; ! for my $totry (@{$conf{nicks}}) { ! unless (grep $_ eq lc $totry, @nicklist) { ! $kernel->post( $server => nick => $totry ); ! return; ! } ! } ! $kernel->delay( ison => 120 ); ! }, ! _stop => sub { ! my $kernel = $_[KERNEL]; ! $kernel->post( $server => quit => $conf{quit} ); ! }, ! _default => sub { ! my ($state, $event, $args, $heap) = @_[STATE, ARG0, ARG1, HEAP]; ! $args ||= [ ]; ! print "default $state = $event (@$args)\n"; ! $heap->{seen_traffic} = 1; ! return 0; ! }, ! irc_001 => sub { ! my ($kernel, $heap) = @_[KERNEL, HEAP]; ! if (defined $conf{flags}) { ! $kernel->post( $server => mode => ! $conf{nicks}->[$heap->{nick_index}] => $conf{flags} ); ! } ! $kernel->post( $server => away => $conf{away} ); ! foreach my $channel (@{$conf{channel}}) { ! $kernel->yield( join => "\#$channel" ); ! } ! $heap->{server_index} = 0; ! }, ! announce => sub { ! my ($kernel, $heap, $channel, $message) = @_[KERNEL, HEAP, ARG0, ARG1]; ! $kernel->post( $server => privmsg => $channel => $message ); ! }, ! irc_ctcp_version => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp version from $who\n"; ! $kernel->post( $server => ctcpreply => $who, "VERSION $conf{cver}" ); ! }, ! irc_ctcp_clientinfo => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp clientinfo from $who\n"; ! $kernel->post( $server => ctcpreply => ! $who, "CLIENTINFO $conf{ccinfo}" ! ); ! }, ! irc_ctcp_userinfo => sub { ! my ($kernel, $sender) = @_[KERNEL, ARG0]; ! my $who = (split /!/, $sender)[0]; ! print "ctcp userinfo from $who\n"; ! $kernel->post( $server => ctcpreply => ! $who, "USERINFO $conf{cuinfo}" ! ); ! }, ! irc_invite => sub { ! my ($kernel, $who, $where) = @_[KERNEL, ARG0, ARG1]; ! $kernel->yield( join => $where ); ! }, ! irc_join => sub { ! my ($kernel, $heap, $who, $where) = @_[KERNEL, HEAP, ARG0, ARG1]; ! my ($nick) = $who =~ /^([^!]+)/; ! add_channel($where) ! if lc $nick eq lc $conf{nicks}->[$heap->{nick_index}]; ! }, ! irc_kick => sub { ! my ($kernel, $heap, $who, $where, $nick, $reason) ! = @_[KERNEL, HEAP, ARG0..ARG3]; ! print "$nick was kicked from $where by $who: $reason\n"; ! remove_channel($where) ! if lc $nick eq lc $conf{nicks}->[$heap->{nick_index}]; ! # $kernel->delay( join => 15 => $where ); ! }, ! irc_disconnected => sub { ! my ($kernel, $server) = @_[KERNEL, ARG0]; ! print "Lost connection to server $server.\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! irc_error => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; ! print "Server error occurred: $error\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! ! irc_socketerr => sub { ! my ($kernel, $error) = @_[KERNEL, ARG0]; ! print "IRC client ($server): socket error occurred: $error\n"; ! clear_channels(); ! $kernel->delay( connect => 60 ); ! }, ! ! irc_public => sub { ! my ($kernel, $heap, $who, $where, $msg) = @_[KERNEL, HEAP, ARG0..ARG2]; ! $who = (split /!/, $who)[0]; ! $where = $where->[0]; ! print "<$who:$where> $msg\n"; ! ! $heap->{seen_traffic} = 1; ! ! # Do something with input here? ! }, }, ! ); } |
From: <ave...@us...> - 2003-10-31 22:41:59
|
Update of /cvsroot/pastebot/pastebot/Util In directory sc8-pr-cvs1:/tmp/cvs-serv18296/Util Modified Files: Conf.pm Log Message: Takes a list of nicknames now. Will try auto-reclaim if all in list are taken. Also indent was in different styles over the file, recommending diff -b. Index: Conf.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Util/Conf.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Conf.pm 8 Jun 2003 16:10:56 -0000 1.5 --- Conf.pm 31 Oct 2003 22:41:56 -0000 1.6 *************** *** 33,37 **** { name => SCALAR | REQUIRED, server => LIST | REQUIRED, ! nick => SCALAR | REQUIRED, uname => SCALAR | REQUIRED, iname => SCALAR | REQUIRED, --- 33,37 ---- { name => SCALAR | REQUIRED, server => LIST | REQUIRED, ! nick => LIST | REQUIRED, uname => SCALAR | REQUIRED, iname => SCALAR | REQUIRED, |
From: <ave...@us...> - 2003-10-31 22:41:59
|
Update of /cvsroot/pastebot/pastebot In directory sc8-pr-cvs1:/tmp/cvs-serv18296 Modified Files: pastebot.conf-dist Log Message: Takes a list of nicknames now. Will try auto-reclaim if all in list are taken. Also indent was in different styles over the file, recommending diff -b. Index: pastebot.conf-dist =================================================================== RCS file: /cvsroot/pastebot/pastebot/pastebot.conf-dist,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pastebot.conf-dist 31 Oct 2003 17:13:59 -0000 1.7 --- pastebot.conf-dist 31 Oct 2003 22:41:56 -0000 1.8 *************** *** 72,78 **** server irc.efnet.pl 6667 ! # The nickname this client will use. nick eatpaste # The user name this client will advertise when connecting to --- 72,82 ---- server irc.efnet.pl 6667 ! # The nickname[s] this client will use. If all in the list are ! # taken some digits are appended, and it will try to reclaim one ! # of the nicks in the list from time to time. nick eatpaste + # nick keinpaste + # nick paste-it # The user name this client will advertise when connecting to |
From: <rc...@us...> - 2003-10-31 19:52:05
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv20672/Client Modified Files: IRC.pm Log Message: Ok, damnit, this time with FEELING! Ah, ahem. Fix the port selection code so it doesn't clobber a very important closure variable. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IRC.pm 31 Oct 2003 17:13:59 -0000 1.5 --- IRC.pm 31 Oct 2003 19:52:01 -0000 1.6 *************** *** 111,127 **** my ($kernel, $heap) = @_[KERNEL, HEAP]; ! my $server = $conf{server}->[$heap->{server_index}]; ! my $port = 6667; ! if ($server =~ s/[\s\:]+(\S+)\s*$//) { ! $port = $1; } ! warn "server($server) port($port)"; $kernel->post( $server => connect => { Debug => 0, Nick => $conf{nick}, ! Server => $server, ! Port => $port, Username => $conf{uname}, Ircname => $conf{iname}, --- 111,127 ---- my ($kernel, $heap) = @_[KERNEL, HEAP]; ! my $chosen_server = $conf{server}->[$heap->{server_index}]; ! my $chosen_port = 6667; ! if ($chosen_server =~ s/[\s\:]+(\S+)\s*$//) { ! $chosen_port = $1; } ! # warn "server($chosen_server) port($chosen_port)"; $kernel->post( $server => connect => { Debug => 0, Nick => $conf{nick}, ! Server => $chosen_server, ! Port => $chosen_port, Username => $conf{uname}, Ircname => $conf{iname}, |
From: <rc...@us...> - 2003-10-31 17:14:03
|
Update of /cvsroot/pastebot/pastebot In directory sc8-pr-cvs1:/tmp/cvs-serv22506 Modified Files: pastebot.conf-dist Log Message: Add support for nonstandard server ports. Thanks to Chris Ellsworth for requesting it, or you'd still be waiting for it. :) Just throw a port number on the server lines in pastebot.conf, separated from the server host by spaces and/or colons, and you're good to go. The default is 6667 if you leave ports out. Index: pastebot.conf-dist =================================================================== RCS file: /cvsroot/pastebot/pastebot/pastebot.conf-dist,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pastebot.conf-dist 11 Jun 2003 17:32:41 -0000 1.6 --- pastebot.conf-dist 31 Oct 2003 17:13:59 -0000 1.7 *************** *** 59,72 **** name efnet ! # A list of IRC servers to connect to. The bot will cycle ! # through them in order, so put your favorites first. ! server irc.carrier1.net.uk ! server irc.daxnet.no ! server irc.arcti.ca ! server irc2.lightning.net ! server irc.Qeast.net ! server irc.homelien.no ! server irc.efnet.pl # The nickname this client will use. --- 59,74 ---- name efnet ! # A list of IRC servers and ports to connect to. The bot will ! # cycle through them in order, so put your favorites first. ! # ! # Port numbers are optional and will default to 6667 if omitted. ! server irc.carrier1.net.uk 6667 ! server irc.daxnet.no 6667 ! server irc.arcti.ca 6667 ! server irc2.lightning.net 6667 ! server irc.Qeast.net 6667 ! server irc.homelien.no 6667 ! server irc.efnet.pl 6667 # The nickname this client will use. |
From: <rc...@us...> - 2003-10-31 17:14:03
|
Update of /cvsroot/pastebot/pastebot/Client In directory sc8-pr-cvs1:/tmp/cvs-serv22506/Client Modified Files: IRC.pm Log Message: Add support for nonstandard server ports. Thanks to Chris Ellsworth for requesting it, or you'd still be waiting for it. :) Just throw a port number on the server lines in pastebot.conf, separated from the server host by spaces and/or colons, and you're good to go. The default is 6667 if you leave ports out. Index: IRC.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Client/IRC.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IRC.pm 6 Jul 2003 17:49:09 -0000 1.4 --- IRC.pm 31 Oct 2003 17:13:59 -0000 1.5 *************** *** 111,119 **** my ($kernel, $heap) = @_[KERNEL, HEAP]; $kernel->post( $server => connect => { Debug => 0, Nick => $conf{nick}, ! Server => $conf{server}->[$heap->{server_index}], ! Port => 6667, Username => $conf{uname}, Ircname => $conf{iname}, --- 111,127 ---- my ($kernel, $heap) = @_[KERNEL, HEAP]; + my $server = $conf{server}->[$heap->{server_index}]; + my $port = 6667; + if ($server =~ s/[\s\:]+(\S+)\s*$//) { + $port = $1; + } + + warn "server($server) port($port)"; + $kernel->post( $server => connect => { Debug => 0, Nick => $conf{nick}, ! Server => $server, ! Port => $port, Username => $conf{uname}, Ircname => $conf{iname}, |
From: <rc...@us...> - 2003-10-31 16:49:26
|
Update of /cvsroot/pastebot/pastebot In directory sc8-pr-cvs1:/tmp/cvs-serv18242 Modified Files: MANIFEST MANIFEST.SKIP Makefile Log Message: Woops. Forgot some things wrt snapshot building. Index: MANIFEST =================================================================== RCS file: /cvsroot/pastebot/pastebot/MANIFEST,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANIFEST 17 Oct 2002 03:19:48 -0000 1.1 --- MANIFEST 31 Oct 2003 16:49:21 -0000 1.2 *************** *** 1,5 **** - CHANGES COPYRIGHT Client/IRC.pm MANIFEST MANIFEST.SKIP --- 1,5 ---- COPYRIGHT Client/IRC.pm + Data/SQLite.pm MANIFEST MANIFEST.SKIP *************** *** 11,14 **** --- 11,15 ---- Util/Data.pm Util/Web.pm + data/nopaste.gif pastebot.conf-dist pastebot.perl Index: MANIFEST.SKIP =================================================================== RCS file: /cvsroot/pastebot/pastebot/MANIFEST.SKIP,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANIFEST.SKIP 17 Oct 2002 03:19:48 -0000 1.1 --- MANIFEST.SKIP 31 Oct 2003 16:49:22 -0000 1.2 *************** *** 3,7 **** --- 3,12 ---- ~$ ^pastebot.conf$ + ^pastebot.conf-nopaste$ /\.# ^\.# ^MANIFEST\.bak$ + \.swp$ + ^CHANGES$ + \.orig$ + pastestore Index: Makefile =================================================================== RCS file: /cvsroot/pastebot/pastebot/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 17 Oct 2002 03:19:48 -0000 1.1 --- Makefile 31 Oct 2003 16:49:22 -0000 1.2 *************** *** 1,3 **** ! VERSION=20021017 DISTNAME=pastebot-$(VERSION) DISTBUILD=$(DISTNAME) --- 1,3 ---- ! VERSION=20031031 DISTNAME=pastebot-$(VERSION) DISTBUILD=$(DISTNAME) |