+
+ # and finally, see if the user triggered masshl
+ mm = m.plainmessage.irc_downcase(m.server.casemap).split(/[\s\.,:]/)
+ nicks_said = (m.channel.users.map { |u| u.downcase} & mm).size
+ return unless nicks_said > 0 # not really needed, but saves some cycles
+ got_nicks = 0
+ masshl_action = nil
+ @registry[:masshl].each { |masshl|
+ next unless masshl.channel == m.channel.downcase or masshl.channel == "all"
+ needed = [masshl.num.to_i, (masshl.perc * m.channel.user_nicks.size / 100).to_i].max
+ next if needed > nicks_said or needed < got_nicks
+ masshl_action = masshl
+ got_nicks = needed
+ }
+ return unless masshl_action
+ do_cmd masshl_action.action.intern, m.sourcenick, m.channel, masshl_action.timer, masshl_action.reason