]> git.donarmstrong.com Git - infobot.git/commitdiff
- "news read ." shows expire time now.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 6 May 2001 13:57:35 +0000 (13:57 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 6 May 2001 13:57:35 +0000 (13:57 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@475 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/News.pl

index 8c0ff10ce0bf7e74bc4fa6e2519017a858a93f2b..f3d12e733197a1e2e413947ba036d7ca5af6141e 100644 (file)
@@ -424,20 +424,30 @@ sub read {
     my $rcount = $::news{$chan}{$item}{Request_Count} || 0;
 
     if (length $text < $::param{maxKeySize}) {
-       &::DEBUG("NEWS: Possible news->factoid redirection.");
+       &::VERB("NEWS: Possible news->factoid redirection.",2);
        my $f   = &::getFactoid($text);
 
        if (defined $f) {
-           &::DEBUG("NEWS: ok, $text is factoid redirection.");
+           &::VERB("NEWS: ok, $text is factoid redirection.",2);
            $f =~ s/^<REPLY>\s*//i;     # anything else?
            $text = $f;
        }
     }
 
+    $_ = $::news{$chan}{$item}{'Expire'};
+    my $e;
+    if ($_) {
+       $e = sprintf("\037%s\037  [%s from now]",
+               scalar(localtime($_)),
+               &::Time2String($_ - time())
+       );
+    }
+
     &::notice($::who, "+- News \002$chan\002 #$num: \037$item\037");
-    &::notice($::who, "| Added by $a at $t");
-    &::notice($::who, "| Requested $rcount times, last by $rwho") if ($rcount);
+    &::notice($::who, "| Added by $a at \037$t\037");
+    &::notice($::who, "| Expire: $e") if (defined $e);
     &::notice($::who, $text);
+    &::notice($::who, "| Requested \002$rcount\002 times, last by \002$rwho\002") if ($rcount and $rwho);
 
     $::news{$chan}{$item}{'Request_By'}   = $::who;
     $::news{$chan}{$item}{'Request_Time'} = time();