From ec01ceeee9053ddad124f000d20439e21acae54c Mon Sep 17 00:00:00 2001 From: dms Date: Sun, 6 May 2001 13:57:35 +0000 Subject: [PATCH] - "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 --- src/Modules/News.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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(); -- 2.39.5