- key.sub!(/^\((.*)\)$/, "\1")
- key.gsub!(/\s+/, " ")
- next unless(key.length > 0)
- next if(key == m.sourcenick)
- if(change == "++")
- @registry[key] += 1
- elsif(change == "--")
- @registry[key] -= 1
+ def message(m)
+ return unless m.public? && m.message.match(/\+\+|--/)
+ arg = nil
+ op = nil
+ ac = Hash.new
+ m.message.split.each_with_index do |tok, i|
+ tok.sub!(/[:,]$/, '') if i == 0
+ catch :me_if_you_can do
+ if m.channel.users[tok].nil?
+ if (tok =~ /^(?:--)(.*[^-].*)$/) || (tok =~ /^(.*[^-].*)(?:--)$/)
+ op, arg = '--', $1
+ next
+ elsif (tok =~ /^(?:\+\+)(.*[^+].*)$/)||(tok =~ /^(.*[^+].*)(?:\+\+)$/)
+ op, arg = '++', $1
+ next
+ end
+ end
+
+ if (tok =~ /^--+$/) || (tok =~ /^\+\++$/)
+ op = tok.slice(0, 2)
+ else
+ arg = tok