summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-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