summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2009-01-21 20:37:37 +0000
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2009-01-21 20:37:37 +0000
commitaa3a61f1d07be3c892a4b9574f980065bc8a72ea (patch)
tree22e6c156ad8e4ef59ae744369b1b159fcb880bd5
parent10bf019ac2b7e0e1f6a6e9af790560cde21fc5ea (diff)
fixed the canspeak routine to work with the default xml channel
-rw-r--r--modules/util.pl20
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