From 685e52656b62675ff423e6c41c923a986e3ddd68 Mon Sep 17 00:00:00 2001
From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
Date: Mon, 22 Jun 2026 14:06:19 -0400
Subject: [PATCH] nip71: account-level "auto-share new public videos" toggle
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adds an opt-in account preference (off by default, per pubkey) that
auto-mirrors newly published eligible public videos to NIP-71
(kinds 34235/34236) so they surface on other Nostr video clients —
no per-video opt-in needed.
- nip71MirrorFlags: isAutoShareEnabled/setAutoShareEnabled (persisted
per pubkey) + pure resolvePublishSync({featureOn,autoShare,eligible}).
- nip71MirrorSync: syncNip71MirrorAfterPublish + a videos:published
subscription in initNip71MirrorSync; converts the canonical 30078
event, checks eligibility (public + hosted URL + ALLOW_NSFW gate),
publishes the mirror, and records the per-video flag so later
edits/deletes stay in lockstep. All best-effort.
- My Videos pane: an "Auto-share new public videos to other Nostr apps"
checkbox wired to setAutoShareEnabled, gated by FEATURE_NIP71_MIRROR.
Tests (mutation-verified): auto-share persistence, resolvePublishSync
(eligible+on=>publish; off/ineligible=>none), and videos:published
subscription wiring.
Co-Authored-By: Claude Opus 4.8
---
components/profile-modal.html | 4 ++
js/services/nip71MirrorFlags.js | 51 ++++++++++++++++++++++++
js/services/nip71MirrorSync.js | 44 ++++++++++++++++++++
js/ui/profileModal/MyVideosController.js | 29 ++++++++++++++
tests/nip71-mirror-flags.test.mjs | 20 ++++++++++
tests/nip71-mirror-sync.test.mjs | 1 +
6 files changed, 149 insertions(+)
diff --git a/components/profile-modal.html b/components/profile-modal.html
index 51421cdf..1f19b708 100644
--- a/components/profile-modal.html
+++ b/components/profile-modal.html
@@ -1028,6 +1028,10 @@
role="status"
aria-live="polite"
>