sub list {
if (!scalar keys %{ $::news{$chan} }) {
- &::notice($who, "No News for \002$chan\002.");
+ &::notice($who, "No news for \002$chan\002.");
return;
}
}
if (!scalar keys %{ $::news{$chan} }) {
- &::notice($who, "No News for \002$chan\002.");
+ &::notice($who, "No news for \002$chan\002.");
return;
}
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);
}
}
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}) {
$::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");
- &::DEBUG("news: something went really wrong.");
- &::DEBUG("news: chan => $chan.");
+ &::DEBUG("news: $chan: something went really wrong.");
return;
}
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) {
$i = &newsS2N($_);
$sorted[$i] = $_;
}
-
+
for ($i=0; $i<=scalar(@sorted); $i++) {
my $news = $sorted[$i];
next unless (defined $news);