[pastebot-cvs] pastebot/Server Web.pm,1.13,1.14
Status: Beta
Brought to you by:
rcaputo
From: <ju...@us...> - 2003-07-06 17:49:25
|
Update of /cvsroot/pastebot/pastebot/Server In directory sc8-pr-cvs1:/tmp/cvs-serv5243/Server Modified Files: Web.pm Log Message: Added dynamic channel management. Pastes can now only go to joined channels. Util::Data::channels() returns wantarray ? channel names : number of channels Util::Data::clear_channels() returns success ? true : false Util::Data::add_channel($channel) returns success ? new number of channels : false Util::Data::remove_channel($channel) returns success ? number of removed channels (should be 1) : false Removed my_chans in Client::IRC. channels() should be used now. Updated error message when pasting to unknown channel. Channel may be known ($ircconf{channel}), but not joined (channels()). Index: Web.pm =================================================================== RCS file: /cvsroot/pastebot/pastebot/Server/Web.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Web.pm 8 Jun 2003 16:10:56 -0000 1.13 --- Web.pm 6 Jul 2003 17:49:09 -0000 1.14 *************** *** 54,58 **** my ( $heap, $socket, $remote_address, $remote_port, ! $my_name, $my_host, $my_port, $my_ifname, $my_isrv, $my_chans, $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..$#_]; *************** *** 67,71 **** $heap->{my_iname} = $my_iname; $heap->{my_isrv} = $my_isrv; - $heap->{my_chans} = $my_chans; $heap->{my_proxy} = $proxy; --- 67,70 ---- *************** *** 181,188 **** # Goes as a separate block. if (length $channel) { ! unless (grep { "\#$_" eq $channel } @{$heap->{my_chans}}) { $error = ( "<p><b><font size='+1' color='#800000'>" . ! "The channel you pasted to is not known." . "</font></b></p>" ); --- 180,187 ---- # Goes as a separate block. if (length $channel) { ! unless (grep $_ eq $channel, channels()) { $error = ( "<p><b><font size='+1' color='#800000'>" . ! "I'm not on $channel." . "</font></b></p>" ); *************** *** 346,350 **** # file's list. ! my @tmpchans = @{$heap->{my_chans}}; my @channels; --- 345,349 ---- # file's list. ! my @tmpchans = channels(); my @channels; *************** *** 352,355 **** --- 351,355 ---- my $prefchan = $1; if ($prefchan) { + $prefchan =~ s/^/#/; push @channels, grep { $_ eq $prefchan } @tmpchans; push @channels, grep { $_ ne $prefchan } @tmpchans; *************** *** 359,364 **** if (@channels) { ! @channels = map { "<option value='\#$_'>\#$_" } @channels; ! $channels[0] =~ s/\'\>\#/\' selected>\#/; @channels = sort @channels; } --- 359,364 ---- if (@channels) { ! @channels = map { "<option value='$_'>$_" } @channels; ! $channels[0] =~ s/\'\>/\' selected>/; @channels = sort @channels; } *************** *** 490,494 **** [ @_[ARG0..ARG2], $server, $conf{iface}, $conf{port}, $conf{ifname}, $conf{irc}, ! $ircconf{channel}, $conf{proxy}, $conf{iname}, ], ); --- 490,494 ---- [ @_[ARG0..ARG2], $server, $conf{iface}, $conf{port}, $conf{ifname}, $conf{irc}, ! $conf{proxy}, $conf{iname}, ], ); |