Advertise doesn't need to check identification, it's handled through the unified...
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 5 Nov 2007 20:31:31 +0000 (20:31 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 5 Nov 2007 20:31:31 +0000 (20:31 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@32 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml

index 77a7e62..61913e1 100644 (file)
@@ -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 <period> <outputmodule>:<outputmethod>:<outputtarget> <message>", $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 <period> <outputmodule>:<outputmethod>:<outputtarget> <message>", $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++;
+        }
+      }
     }
   }