[vhffs-dev] [1581] Added tag requests to moderation list. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1581
Author: guillaumito
Date: 2010-03-29 00:23:45 +0200 (Mon, 29 Mar 2010)
Log Message:
-----------
Added tag requests to moderation list.
This is the first step toward tag moderation through pacman.
Modified Paths:
--------------
trunk/vhffs-irc/modobot.pl
Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl 2010-03-28 22:06:19 UTC (rev 1580)
+++ trunk/vhffs-irc/modobot.pl 2010-03-28 22:23:45 UTC (rev 1581)
@@ -20,6 +20,7 @@
use Vhffs::Object;
use Vhffs::ObjectFactory;
use Vhffs::Tag;
+use Vhffs::Tag::Request;
use Net::IRC;
use Net::DNS;
@@ -31,6 +32,7 @@
my $cmpt = 0;
my %oldobjects = ();
+my %oldrequests = ();
my $irc=new Net::IRC;
@@ -87,6 +89,18 @@
$oldobjects{$obj->get_oid} = '';
}
}
+
+ my $requests = Vhffs::Tag::Request::get_all($vhffs);
+ foreach my $r (@$requests) {
+ next if ( $seq && exists( $oldrequests{$r->{request_id}} ) );
+
+ my $duration = delay_modo($r->{created});
+
+ my $msg = '[' . $duration.'] tag request: ' . $r->{request_id} . ' ' . $r->{category_label} . '::' . $r->{tag_label};
+ irc_msg( $msg );
+
+ $oldrequests{$r->{request_id}} = '';
+ }
}
sub delay_modo