From aa3a61f1d07be3c892a4b9574f980065bc8a72ea Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Wed, 21 Jan 2009 20:37:37 +0000 Subject: fixed the canspeak routine to work with the default xml channel --- modules/util.pl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'modules') 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 -- cgit v1.2.3