[vhffs-dev] [1474] Fixed comment when accepting a submission.

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


Revision: 1474
Author:   florent
Date:     2009-07-17 23:05:23 +0200 (Fri, 17 Jul 2009)

Log Message:
-----------
Fixed comment when accepting a submission.

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


Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl	2009-07-16 07:49:31 UTC (rev 1473)
+++ trunk/vhffs-irc/modobot.pl	2009-07-17 21:05:23 UTC (rev 1474)
@@ -358,12 +358,15 @@
     my ($nick, $mynick)=($event->nick, $self->nick);
     my $texte=$event->{args}[0];
 
-    if ($texte =~ m/^${mynick}: accept [0-9]+ .*$/)
+    if ($texte =~ m/^${mynick}: accept [0-9]+.*$/)
     {
         if (is_modo ($nick) == 1)
 	{
-	    $texte =~ s/^${mynick}: accept //;
-            moderate( $texte , 1 );
+	    my $oid = $texte;
+	    my $raison = $texte;
+	    $raison =~ s/^${mynick}: accept [0-9]+ //;
+	    $oid =~ s/^${mynick}: accept ([0-9]+).*$/$1/;
+            moderate( $oid , 1 , $raison);
 	}
     }
     elsif ($texte =~ m/^${mynick}: refuse [0-9]+ .*$/)
@@ -381,7 +384,7 @@
     {
         irc_msg("Commands :");
         irc_msg("help - show this help");
-        irc_msg("accept <oid> - accept object with id <oid>");
+        irc_msg("accept <oid> [reason] - accept object with id <oid> for reason [reason]");
         irc_msg("refuse <oid> <reason> - refuse object with id <oid> for reason <reason>");
 	irc_msg("list - force listing of all objects waiting for moderation");
 	irc_msg("desc <group> - give the description of <group>");


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