]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/News.pl
- bah, was editting the comments in another xterm but ^C'd it and lost
[infobot.git] / src / Modules / News.pl
index 33d8933d86b923f3b833bd29b5cb98ab8abc91aa..478c86104b8782e96101a4fc76278c8bb04baa16 100644 (file)
@@ -789,6 +789,12 @@ sub latest {
     if (!$flag) {
        return unless ($unread);
 
+       if ($::cache{newsTime} - time() < 5) {
+           &::status("news: not displaying latest notice to $who/$chan.");
+           return;
+       }
+
+       $::cache{newsTime} = time();
        my $reply = "There are unread news in $chan ($unread unread, $total total). /msg $::ident news $::chan latest";
        $reply   .= "  If you don't want further news notification, /msg $::ident news unnotify" if ($unread == $total);
        &::notice($who, $reply);