[vhffs-dev] [969] Fix echo bug

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 969
Author:   gradator
Date:     2007-10-06 14:02:30 +0000 (Sat, 06 Oct 2007)

Log Message:
-----------
Fix echo bug

Modified Paths:
--------------
    trunk/vhffs-irc/modobot.pl


Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl	2007-10-06 13:45:14 UTC (rev 968)
+++ trunk/vhffs-irc/modobot.pl	2007-10-06 14:02:30 UTC (rev 969)
@@ -57,10 +57,12 @@
 
 sub list_moderation
 {
+	my $seq = shift;  # 1 to sequential display
+
 	my $objects = Vhffs::Object::getall( $vhffs, undef, Vhffs::Constants::WAITING_FOR_VALIDATION );
 	if( defined $objects )  {
 		foreach my $obj ( @{$objects} ) {
-			next if exists( ${%oldobjects}{$obj->get_oid} );
+			next if( $seq && exists( ${%oldobjects}{$obj->get_oid} ) );
 
 			my $user = $obj->get_user;
 			my $group = $obj->get_group;
@@ -71,12 +73,11 @@
 			$msg .= ' ['.$user->get_lang.']   '.$group->get_groupname.'   '.$object->get_label.'   '.$obj->get_description;
 			irc_msg( $msg );
 
-			${%oldobjects}{$obj->get_oid} = '';
+			${%oldobjects}{$obj->get_oid} = '' if $seq;
 		}
 	}
 }
 
-
 sub moderate
 {
 	my $oid = shift;
@@ -301,8 +302,7 @@
    }
     elsif ($texte =~ m/^${mynick}: list$/)
     {
-	%oldobjects = ();
-	list_moderation();
+	list_moderation( 0 );
     }
     elsif ($texte =~ m/^${mynick}: desc [a-z0-9]+$/)
     {
@@ -355,7 +355,7 @@
 
 sub CatchAlrm
 {
-    list_moderation ();
+    list_moderation( 1 );
     alarm 60;
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/