+ my @chans = &ChanConfList($args);
+ &DEBUG("scalar chans => ".scalar(@chans) );
+ if (scalar @chans == 1 and $chans[0] eq '_default' and !$no_chan) {
+ &performStrictReply("ok, $args was set only for _default; unsetting for _defaul but setting for other chans.");
+
+ my $val = $chanconf{$_}{_default};
+ foreach (keys %chanconf) {
+ $chanconf{$_}{$args} = $val;
+ }
+ delete $chanconf{_default}{$args};
+ $cache{confvars}{$args} = 0;
+ &rehashConfVars();
+
+ return;
+ }
+
+ if ($no_chan and !exists($chanconf{_default}{$args})) {
+ &performStrictReply("ok, $args for _default does not exist, removing from all chans.");
+
+ foreach (keys %chanconf) {
+ next unless (exists $chanconf{$_}{$args});
+ &DEBUG("delete chanconf{$_}{$args};");
+ delete $chanconf{$_}{$args};
+ }
+ $cache{confvars}{$args} = 0;
+ &rehashConfVars();
+
+ return;
+ }
+
+ &performStrictReply("Unsetting channel ($chan) option $args. (was $chanconf{$chan}{$args})");
+ delete $chanconf{$chan}{$args};
+