code: def identify_request(request: RequestType):
      
      # Private encrypted JSON payload
      try:
          data = json.loads(decode_if_bytes(request.body))
          if "encrypted_magic_envelope" in data:
              return True
      except Exception:
          pass
      # Public XML payload
      try:
          xml = etree.fromstring(encode_if_text(request.body))
          if xml.tag == MAGIC_ENV_TAG:
              return True
      except Exception:
          pass
      return False
docs: Try to identify whether this is a Diaspora request.
  
      Try first public message. Then private message. The check if this is a legacy payload.