From 42592566d0395b130f1acd43d55b17c663e91d05 Mon Sep 17 00:00:00 2001 From: dms Date: Fri, 6 Apr 2001 13:56:50 +0000 Subject: [PATCH] Just some more minor changes, to make some people happy, heh. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@428 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Modules/News.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Modules/News.pl b/src/Modules/News.pl index 28ca58a..1446db1 100644 --- a/src/Modules/News.pl +++ b/src/Modules/News.pl @@ -22,14 +22,15 @@ sub Parse { $chan = undef; if ($::msgType eq "private") { - # todo: check if the channel exists aswell. - if (defined $what and $what =~ s/^($::mask{chan})\s*//) { - $chan = $1; - } } else { $chan = $::chan; } + if (defined $what and $what =~ s/^($::mask{chan})\s*//) { + # todo: check if the channel exists aswell. + $chan = $1; + } + if (!defined $chan) { my @chans = &::GetNickInChans($::who); @@ -130,6 +131,11 @@ sub readNews { } sub writeNews { + if (!scalar keys %::news) { + &::DEBUG("wN: nothing to write."); + return; + } + my $file = "$::bot_base_dir/blootbot-news.txt"; if (fileno NEWS) { @@ -302,7 +308,7 @@ sub list { } my $timestr = &::Time2String(time() - $newest); &::msg($::who, "|= Last updated $timestr ago."); - &::msg($::who, " \037No\037 \037Item ".(" "x40)." \037"); + &::msg($::who, " \037Num\037 \037Item ".(" "x40)." \037"); my $i = 1; foreach ( &getNewsAll() ) { -- 2.39.5