From 5b6af3de9ca59d494b11804bfc4df2b24f232df0 Mon Sep 17 00:00:00 2001
From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
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@428 c11ca15a-4712-0410-83d8-924469b57eb5
---
 blootbot/src/Modules/News.pl | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/blootbot/src/Modules/News.pl b/blootbot/src/Modules/News.pl
index 28ca58a..1446db1 100644
--- a/blootbot/src/Modules/News.pl
+++ b/blootbot/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