]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/News.pl
ws
[infobot.git] / src / Modules / News.pl
index 930175aa736bc9b5ea261db1181fcfa4ae93c97d..caee5f104751e0fab85324b543997dfecb8f4292 100644 (file)
@@ -542,7 +542,7 @@ sub mod {
        if ($flags eq "") {
            $done++ if (!$done and $mod_news  =~ s/\Q$op\E/$np/);
            $done++ if (!$done and $mod_nnews =~ s/\Q$op\E/$np/);
-        } elsif ($flags eq "g") {
+       } elsif ($flags eq "g") {
            $done++ if ($mod_news  =~ s/\Q$op\E/$np/g);
            $done++ if ($mod_nnews =~ s/\Q$op\E/$np/g);
        }
@@ -721,11 +721,11 @@ sub set {
 }
 
 sub latest {
-    my($tchan, $flag) = @_;
+    my ($tchan, $flag) = @_;
 
-    # hack hack hack.
-    $chan ||= $tchan;
-    $who    = $::who;
+    # hack hack hack.  fix later.
+    $chan = $tchan;
+    $who  = $::who;
 
     # todo: if chan = undefined, guess.
 #    if (!exists $::news{$chan}) {
@@ -752,9 +752,10 @@ sub latest {
 
     $::chan    = $chan;
     my $x = &::IsChanConf("newsNotifyAll");
-    if (&::IsChanConf("newsNotifyAll") and !defined $t) {
-       $t = 1;
-    }
+    return if (!$x);
+
+    # I don't understand this code ;)
+    $t = 1 if (!defined $t);
 
     if (!defined $t) {
 #      &::msg($who, "News is disabled for $chan");
@@ -798,7 +799,7 @@ sub latest {
     if (!$flag) {
        return unless ($unread);
 
-       # just a temporary measure not to flood ourself off the 
+       # just a temporary measure not to flood ourself off the
        # network with news until we get global notice() and msg()
        # throttling.
        if (time() - ($::cache{newsTime} || 0) < 5) {
@@ -830,7 +831,7 @@ sub latest {
            $i   = &newsS2N($_);
            $sorted[$i] = $_;
        }
-       
+
        for ($i=0; $i<=scalar(@sorted); $i++) {
            my $news = $sorted[$i];
            next unless (defined $news);