From: dms Date: Sun, 6 May 2001 13:57:35 +0000 (+0000) Subject: - "news read ." shows expire time now. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ec01ceeee9053ddad124f000d20439e21acae54c;p=infobot.git - "news read ." shows expire time now. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@475 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Modules/News.pl b/src/Modules/News.pl index 8c0ff10..f3d12e7 100644 --- a/src/Modules/News.pl +++ b/src/Modules/News.pl @@ -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/^\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();