# File rbot/plugins/nickserv.rb, line 33
  def privmsg(m)
    return unless m.params
    
    case m.params
    when (/^password\s*(\S*)\s*(.*)$/)
      nick = $1
      passwd = $2
      @registry[nick] = passwd
      @bot.okay m.replyto
    when (/^register$/)
      passwd = genpasswd
      @bot.sendmsg "PRIVMSG", "NickServ", "REGISTER " + passwd
      @registry[nick] = passwd
      @bot.okay m.replyto
    when (/^register\s*(.*)\s*$/)
      passwd = $1
      @bot.sendmsg "PRIVMSG", "NickServ", "REGISTER " + passwd
      @bot.okay m.replyto
    when (/^listnicks$/)
      if @bot.auth.allow?("config", m.source, m.replyto)
        if @registry.length > 0
          @registry.each {|k,v|
            @bot.say m.sourcenick "#{k} => #{v}"
          }
        else
          m.reply "none known"
        end
      end
    when (/^identify$/)
      if @registry.has_key?(@bot.nick)
        @bot.sendmsg "PRIVMSG", "NickServ", "IDENTIFY " + @registry[@bot.nick]
        @bot.okay m.replyto
      else
        m.reply "I dunno the nickserv password for the nickname #{@bot.nick} :("
      end
    end
  end