+
+ } elsif ($what =~ /^(un)?notify$/i) {
+ my $state = ($1) ? 0 : 1;
+
+ # todo: don't notify even if "news" is called.
+ if (!&::IsChanConf("newsNotifyAll")) {
+ &::msg($::who, "not available for this channel or disabled altogether.");
+ return;
+ }
+
+ my $t = $::newsuser{$chan}{$::who};
+ if ($state) { # state = 1
+ if (defined $t and ($t == 0 or $t == -1)) {
+ &::msg($::who, "enabled notify.");
+ delete $::newsuser{$chan}{$::who};
+ return;
+ }
+ &::msg($::who, "already enabled.");
+
+ } else { # state = 0
+ my $x = $::newsuser{$chan}{$::who};
+ if (defined $x and ($x == 0 or $x == -1)) {
+ &::msg($::who, "notify already disabled");
+ return;
+ }
+ $::newsuser{$chan}{$::who} = -1;
+ &::msg($::who, "notify is now disabled.");
+ }
+