From 2154a1a11240610a0ea1d848d141858202b40054 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Mon, 5 Nov 2007 20:31:31 +0000 Subject: [PATCH] Advertise doesn't need to check identification, it's handled through the unified system. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@32 088b83a4-0077-4247-935c-42ec02c2848b --- commands.yaml | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/commands.yaml b/commands.yaml index 77a7e62..61913e1 100644 --- a/commands.yaml +++ b/commands.yaml @@ -525,41 +525,37 @@ ADVERTISE: |- my( $time, $how, $message ) = split( / /, $what, 3 ); my( $prot, $type, $targ ) = split( /:/, $how, 3 ); $time = int( $time ); - if( exists( $heap->{ 'identified' }->{ uc( $who ) } ) ) { - if( length( $what ) > 0 && $time >= 0 ) { - if( $message ) { - if( !exists( $heap->{ 'ads' } ) ) { - $heap->{ 'ads' } = []; - } - my $ad = scalar( @{ $heap->{ 'ads' } } ); - $heap->{ 'ads' }->[ $ad ] = [ $time, $prot, $type, $targ, $message ]; - $kernel->delay_set( "advertise", $time, $ad ); - $kernel->post( $src, $replypath, "$who: Advert added as #".$ad, $dest ); - } else { - if( exists( $heap->{ 'ads' }->[ $time ] ) ) { - $kernel->post( $src, $replypath, "$who: Ad disabled.", $dest ); - print( "ADVERTISE: Ad #".$time." disabled.\n" ); - $heap->{ 'ads' }->[ $time ]->[0] = -1; - } else { - $kernel->post( $src, $replypath, "$who: Ad #".$time." not found.", $dest ); - print( "ADVERTISE: Ad #".$time." not found.\n" ); - } + if( length( $what ) > 0 && $time >= 0 ) { + if( $message ) { + if( !exists( $heap->{ 'ads' } ) ) { + $heap->{ 'ads' } = []; } + my $ad = scalar( @{ $heap->{ 'ads' } } ); + $heap->{ 'ads' }->[ $ad ] = [ $time, $prot, $type, $targ, $message ]; + $kernel->delay_set( "advertise", $time, $ad ); + $kernel->post( $src, $replypath, "$who: Advert added as #".$ad, $dest ); } else { - $kernel->post( $src, $replypath, "Usage: ADVERTISE :: ", $dest ); - $kernel->post( $src, $replypath, "Ex. : ADVERTISE 3600 mod_irc:send_public_to:#dc Hourly Advertisement", $dest ); - if( exists( $heap->{ 'ads' } ) ) { - $kernel->post( $src, $replypath, "Current advertisements:", $dest ); - my $i = 0; - for( @{ $heap->{ 'ads' } } ) { - my( $period, $prot, $type, $targ, $message ) = @{ $_ }; - $kernel->post( $src, $replypath, "$i: ($period) -> $prot:$type:$targ : $message", $dest ); - $i++; - } + if( exists( $heap->{ 'ads' }->[ $time ] ) ) { + $kernel->post( $src, $replypath, "$who: Ad disabled.", $dest ); + print( "ADVERTISE: Ad #".$time." disabled.\n" ); + $heap->{ 'ads' }->[ $time ]->[0] = -1; + } else { + $kernel->post( $src, $replypath, "$who: Ad #".$time." not found.", $dest ); + print( "ADVERTISE: Ad #".$time." not found.\n" ); } } } else { - $kernel->post( $src, $replypath, "'Advertise' is restricted to identified users.", $dest ); + $kernel->post( $src, $replypath, "Usage: ADVERTISE :: ", $dest ); + $kernel->post( $src, $replypath, "Ex. : ADVERTISE 3600 mod_irc:send_public_to:#dc Hourly Advertisement", $dest ); + if( exists( $heap->{ 'ads' } ) ) { + $kernel->post( $src, $replypath, "Current advertisements:", $dest ); + my $i = 0; + for( @{ $heap->{ 'ads' } } ) { + my( $period, $prot, $type, $targ, $message ) = @{ $_ }; + $kernel->post( $src, $replypath, "$i: ($period) -> $prot:$type:$targ : $message", $dest ); + $i++; + } + } } } -- 2.11.0