]> git.donarmstrong.com Git - infobot.git/commitdiff
Just some more minor changes, to make some people happy, heh.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Apr 2001 13:56:50 +0000 (13:56 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Apr 2001 13:56:50 +0000 (13:56 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@428 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/News.pl

index 28ca58a933f417d3c6d1f9e57c819164b02f31ff..1446db18a8694aaa79363549a77e8bd67da8298e 100644 (file)
@@ -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() ) {