]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/Schedulers.pl
plug.org, there should be a general xml news app...
[infobot.git] / src / IRC / Schedulers.pl
index b169c66904aef9bfedb9d3d6471f398b5ed7a578..be8099133cd41a0dac84dc74f0ea369882e4689c 100644 (file)
@@ -34,6 +34,7 @@ sub setupSchedulers {
     &miscCheck2(2);    # mandatory
     &shmFlush(1);      # mandatory
     &slashdotLoop(2);
+    &plugLoop(2);
     &freshmeatLoop(2);
     &kernelLoop(2);
     &wingateWriteFile(2);
@@ -922,6 +923,29 @@ sub slashdotLoop {
     } );
 }
 
+sub plugLoop {
+
+    if (@_) {
+       &ScheduleThis(60, "plugLoop");
+       return if ($_[0] eq "2");
+    }
+
+    my @chans = &ChanConfList("plugAnnounce");
+    return unless (scalar @chans);
+
+    &Forker("plug", sub {
+       my $line = &Plug::plugAnnounce();
+       return unless (defined $line);
+
+       foreach (@chans) {
+           next unless (&::validChan($_));
+
+           &::status("sending plug update to $_.");
+           &notice($_, "Plug: $line");
+       }
+    } );
+}
+
 sub freshmeatLoop {
     if (@_) {
        &ScheduleThis(60, "freshmeatLoop");