submissions(#23): forms publish structured kind-30083 instead of kind-4 DMs

All 5 iframe forms now publish a PUBLIC, structured bitvid submission (kind 30083)
from their ephemeral key instead of a NIP-04 encrypted kind-4 DM — so the admin
Submissions tab can list + approve/deny them.

- application → k=application (+ applicant = the required npub)
- bug-fix → k=bug, feedback → k=feedback, request → k=feature
  (each includes applicant only when the optional npub is filled in)
- content-appeals → k=appeal (no npub field)
Each tags ['d', <id>], ['k', <type>], ['p', <admin hex>], ['t','bitvid-submission'],
['client','bitvid']; the form body goes in plaintext content. The post-publish
verification subscription now watches kind 30083. No encryption anywhere.

Lint + build clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Opus 4.8 committed 2026-07-06 20:44:34 -04:00
1 parent 2a21756842
commit 878f01b819
5 files changed
+105 -69

No files matched your search

@@ -318,21 +318,31 @@ For additional discussions, reach out via bitvid’s Nostr support channels.
// Encrypt the feedback content.
log("Encrypting feedback content (nip04)...");
const ciphertext = await nip04.encrypt(
ephemeralPriv,
targetPubHex,
feedbackContent
);
log("[DEBUG] Ciphertext: " + ciphertext);
log("Encryption done.");
// Build the event template.
// Build a structured bitvid submission (kind 30083, PUBLIC — no
// encryption). Published from the ephemeral key.
const now = Math.floor(Date.now() / 1000);
const submissionId =
"sub-" +
now.toString(36) +
"-" +
Math.random().toString(36).slice(2, 10);
const tags = [
["d", submissionId],
["k", "feedback"],
];
if (userNpub) {
tags.push(["applicant", userNpub]);
}
tags.push(
["p", targetPubHex],
["t", "bitvid-submission"],
["client", "bitvid"]
);
const eventTemplate = {
kind: 4,
kind: 30083,
created_at: now,
tags: [["p", targetPubHex]],
content: ciphertext,
tags,
content: feedbackContent,
};
log(
"[DEBUG] Event template before finalizing: " +
@@ -352,7 +362,7 @@ For additional discussions, reach out via bitvid’s Nostr support channels.
for (const url of RELAYS) {
log("Connecting to " + url + " for subscription...");
const relay = await Relay.connect(url);
relay.subscribe([{ authors: [ephemeralPubHex], kinds: [4] }], {
relay.subscribe([{ authors: [ephemeralPubHex], kinds: [30083] }], {
onEvent(foundEvent) {
if (foundEvent.id === event.id) {
log(