func CopyMessage(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}

	messageID := mux.Vars(req)["message"]

	var input moveMessageInput
	err = httputils.DecodeBody(w, req.Body, &input)
	if err != nil {
		httputils.ErrorOut(w, http.StatusBadRequest, err.Error())
		return
	}

	ar := container.Instance.GetAccountRepo()
	err = ar.CopyMessage(*haddr, messageID, input.To)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}

	httputils.JSONOut(w, http.StatusOK, "")
}
// CopyMessage will copy a message to a box
CopyMessage will copy a message to a box
// CopyMessage will copy a message to a box
func CopyMessage(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}
	messageID := mux.Vars(req)["message"]
	var input moveMessageInput
	err = httputils.DecodeBody(w, req.Body, &input)
	if err != nil {
		httputils.ErrorOut(w, http.StatusBadRequest, err.Error())
		return
	}
	ar := container.Instance.GetAccountRepo()
	err = ar.CopyMessage(*haddr, messageID, input.To)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}
	httputils.JSONOut(w, http.StatusOK, "")
}
func CopyMessage ( w http . ResponseWriter , req * http . Request ) { haddr , err := hash . NewFromHash ( mux . Vars ( req ) [ " " ] ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , accountNotFound ) return } messageID := mux . Vars ( req ) [ " " ] var input moveMessageInput err = httputils . DecodeBody ( w , req . Body , & input ) if err != nil { httputils . ErrorOut ( w , http . StatusBadRequest , err . Error ( ) ) return } ar := container . Instance . GetAccountRepo ( ) err = ar . CopyMessage ( * haddr , messageID , input . To ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , err . Error ( ) ) return } httputils . JSONOut ( w , http . StatusOK , " " ) }
CopyMessage will copy a message to a box
CopyMessage will copy a message to a box