diff --git a/src/lib/components/write/CreateEventForm.svelte b/src/lib/components/write/CreateEventForm.svelte index 82dab6f..545beaa 100644 --- a/src/lib/components/write/CreateEventForm.svelte +++ b/src/lib/components/write/CreateEventForm.svelte @@ -182,8 +182,6 @@ ); const kindMetadata = $derived(getKindMetadata(effectiveKind)); const helpText = $derived(kindMetadata.helpText); - const isKind30040 = $derived(selectedKind === 30040); - const isKind10895 = $derived(selectedKind === 10895); // Clear content for metadata-only kinds (but preserve content when cloning/editing) $effect(() => { @@ -361,12 +359,17 @@ const { processNostrLinks } = await import('../../utils/nostr-link-processor.js'); const processedContent = processNostrLinks(contentWithUrls.trim()); + // Repo announcements (kind 30617) must have empty content per NIP-34 + const finalContent = (effectiveKind === 30617 || effectiveKind === KIND.REPO_ANNOUNCEMENT) + ? '' + : processedContent; + const eventTemplate: Omit = { kind: effectiveKind, pubkey: session.pubkey, created_at: Math.floor(Date.now() / 1000), tags: allTags, - content: processedContent + content: finalContent }; const signedEvent = await session.signer(eventTemplate); @@ -625,7 +628,7 @@ {/if} - {#if !isKind30040 && !isKind10895} + {#if kindMetadata.requiresContent !== false}
diff --git a/src/lib/types/kind-metadata.ts b/src/lib/types/kind-metadata.ts index 581f50a..fa82081 100644 --- a/src/lib/types/kind-metadata.ts +++ b/src/lib/types/kind-metadata.ts @@ -923,8 +923,9 @@ export const KIND_METADATA: Record = { [KIND.REPO_ANNOUNCEMENT]: { ...KIND_LOOKUP[KIND.REPO_ANNOUNCEMENT], writable: true, + requiresContent: false, helpText: { - description: 'Repository Announcement (NIP-34/GRASP). Announces a Git repository. Content contains repository description.', + description: 'Repository Announcement (NIP-34). Announces a Git repository. Content must be empty. Use the description tag for repository description.', suggestedTags: ['d (repository identifier)', 'name (repository name)', 'description', 'clone (git clone URL)', 'web (repository URL)', 'relays (relay URLs)', 'maintainers (pubkey list)', 'image (profile image URL)', 'banner (banner image URL)', 'primary (mark as primary repo)', 'documentation (naddr or kind:pubkey:d-tag format, optional relay)'] }, exampleJSON: (pubkey, eventId, relay, timestamp) => ({