####################################################
# by wiebe @ QuakeNet
#
# devoice users who do not have the access for it
#
####################################################

setudef flag bitchvoice

####################################################
# bitchvoice:mode
####################################################
bind mode -|- "% +v" bitchvoice:mode
proc bitchvoice:mode { n u h c m t } {
  if {![validchan $c]} { return 0 }
  if {[channel get $c inactive]} { return 0 }
  if {![channel get $c bitchvoice]} { return 0 }
  if {[string equal $n ""]} { return 0 }
  if {![string equal $m +v]} { return 0 }
  if {![botisop $c] && ![botishalfop $c]} { return 0 }
  if {[isop $t $c] || [ishalfop $t $c]} { return 0 }
  if {![onchan $t $c]} { return 0 }
  if {[isbotnick $n]} { return 0 }
  if {[matchattr $h bmn|mn $c]} { return 0 }
  set g [nick2hand $t $c]
  if {[matchattr $g bvlomn|vlomn $c] && ![matchattr $g kZ]} { return 0 }
  pushmode $c -v $t
}


set scriptdb(bitchvoice) {
  "denies voice to users who do not have access to it when +bitchvoice is set (servers, bots, masters and owners can voice users without access)"
}

