From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Fri, 8 Nov 2002 16:14:57 +0000 (+0000)
Subject: - modules: woops, used wrong var. should work now.
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=346e5bd13875b55c25c90c58cf186f747100689d;p=infobot.git

- modules: woops, used wrong var. should work now.
- "INIC: invalid chan"... perlness hits back.
- more misc shit.


git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@612 c11ca15a-4712-0410-83d8-924469b57eb5
---

diff --git a/src/Modules/News.pl b/src/Modules/News.pl
index fcf62b9..128bb2c 100644
--- a/src/Modules/News.pl
+++ b/src/Modules/News.pl
@@ -751,9 +751,9 @@ sub latest {
     }
 
     if (!defined $t) {
+#	&::msg($who, "News is disabled for $chan");
 	&::DEBUG("news: something went really wrong.");
-	&::DEBUG("news: chan => $chan, ::chan => $::chan");
-#	&::notice($who, "something went really wrong.");
+	&::DEBUG("news: chan => $chan.");
 	return;
     }
 
@@ -786,7 +786,7 @@ sub latest {
     # scalar @new, !$flag
     my $unread	= scalar @new;
     my $total	= scalar keys %{ $::news{$chan} };
-    if (!$flag) {
+    if (!$flag || &::IsChanConf("newsTellUnread")) {
 	return unless ($unread);
 
 	# just a temporary measure not to flood ourself off the 
@@ -898,6 +898,8 @@ sub getNewsItem {
     my($what)	= @_;
     my $item	= 0;
 
+    $what =~ s/^\#//;	# '#1' for example.
+
     my %time;
     foreach (keys %{ $::news{$chan} }) {
 	my $t = $::news{$chan}{$_}{Time};
diff --git a/src/Process.pl b/src/Process.pl
index 5a166e1..05f297b 100644
--- a/src/Process.pl
+++ b/src/Process.pl
@@ -190,6 +190,8 @@ sub process {
 	my $found = 0;
 
 	foreach (keys %channels) {
+	    # don't test for $channel{_default} elsewhere !!!
+	    next if (/^\s*$/ || /^_?default$/);
 	    next unless (&IsNickInChan($who,$_));
 
 	    $found++;
diff --git a/src/modules.pl b/src/modules.pl
index 09a1ef4..acacb4c 100644
--- a/src/modules.pl
+++ b/src/modules.pl
@@ -337,7 +337,7 @@ sub loadMyModule {
 	    &shutdown() if (defined $shm and defined $dbh);
 	} else {			# child.
 	    &DEBUG("b4 delfork 1");
-	    &delForked($modulebase);
+	    &delForked($modulename);
 	}
 
 	exit 1;
@@ -348,7 +348,7 @@ sub loadMyModule {
 	&ERROR("cannot load my module: $modulebase");
 	if ($bot_pid != $$) {	# child.
 	    &DEBUG("b4 delfork 2");
-	    &delForked($modulebase);
+	    &delForked($modulename);
 	    exit 1;
 	}