(yreq "Utilities/yenta-utils")

(define (sign:body)
  (let* ((id (ui:hex->bytes (ui:form-datum "id")))
	 (msg (ui:form-datum "msg")))
    (list
     (cond ((sign-foreign! id msg)
	    (iy:contact-yenta id 'signatures)
	    (list
	     "I have signed:<blockquote>"
	     (ui:literal msg)
	     "</blockquote> for "
	     (identity:description id)
	     "."))
	   (t
	    "I do not have that attestation to sign."))
     (if (equal? id *local-yenta-id*)
	 "<p><a href=\"attestations.html\">Return to your attestations</a>\n"
	 (list "<p>Return to information about "
	       (identity:description-link id))))))
