diff options
| author | 2009-01-21 20:37:37 +0000 | |
|---|---|---|
| committer | 2009-01-21 20:37:37 +0000 | |
| commit | aa3a61f1d07be3c892a4b9574f980065bc8a72ea (patch) | |
| tree | 22e6c156ad8e4ef59ae744369b1b159fcb880bd5 /modules | |
| parent | 10bf019ac2b7e0e1f6a6e9af790560cde21fc5ea (diff) | |
fixed the canspeak routine to work with the default xml channel
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/util.pl | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/util.pl b/modules/util.pl index 5a32e11..2fa175f 100644 --- a/modules/util.pl +++ b/modules/util.pl @@ -90,11 +90,23 @@ sub speak { my ($module, $chan) = @_; $chan = lc $chan; - if ( defined(cs($module, $chan)->{silence}) && (cs($module, $chan)->{silence} eq "yes") ) { - return 0; - } else { - return 1; + if ( defined($::channels->{channel}->{$chan}->{silence}) ) { + if ($::channels->{channel}->{$chan}->{silence} eq "no") { + return 1; + } + elsif ($::channels->{channel}->{$chan}->{silence} eq "yes") { + return 0; + } + } + if ( defined($::channels->{channel}->{default}->{silence}) ) { + if ( $::channels->{channel}->{default}->{silence} eq "no" ) { + return 1; + } + elsif ( $::channels->{channel}->{default}->{silence} eq "yes" ) { + return 0; + } } + return 1; } #this item is a stub, dur |
