diff --git a/nip66-cron/index.mjs b/nip66-cron/index.mjs index 80c6d332..f019aa91 100644 --- a/nip66-cron/index.mjs +++ b/nip66-cron/index.mjs @@ -28,6 +28,9 @@ import WebSocket from 'ws' const RELAY_DISCOVERY_KIND = 30166 const RELAY_MONITOR_ANNOUNCEMENT_KIND = 10166 +/** Same convention as kind-0 profile metadata (`["bot","true"]`): marks automated monitor output. */ +const MONITOR_BOT_TAG = ['bot', 'true'] + /** * Default URLs to run NIP-11 checks against (30166); always merged with the monitor’s kind 10002 unless overridden. * Union of relay presets in src/constants.ts: DEFAULT_FAVORITE_RELAYS, FAST_READ_RELAY_URLS, @@ -144,7 +147,7 @@ function build30166 (relayUrl, nip11, sk) { kind: RELAY_DISCOVERY_KIND, created_at: Math.floor(Date.now() / 1000), content: '', - tags + tags: [...tags, MONITOR_BOT_TAG] } return finalizeEvent(draft, sk) } @@ -155,7 +158,7 @@ function build10166 (sk) { kind: RELAY_MONITOR_ANNOUNCEMENT_KIND, created_at: Math.floor(Date.now() / 1000), content: '', - tags: [['frequency', String(freqSec)], ['c', 'nip11'], ['c', 'ws']] + tags: [['frequency', String(freqSec)], ['c', 'nip11'], ['c', 'ws'], MONITOR_BOT_TAG] } return finalizeEvent(draft, sk) } diff --git a/src/providers/FavoriteRelaysProvider.tsx b/src/providers/FavoriteRelaysProvider.tsx index e3a9d770..36cd6299 100644 --- a/src/providers/FavoriteRelaysProvider.tsx +++ b/src/providers/FavoriteRelaysProvider.tsx @@ -25,10 +25,9 @@ export function FavoriteRelaysProvider({ children }: { children: React.ReactNode useEffect(() => { if (!favoriteRelaysEvent) { - // For anonymous users (no login), only use relays from FAST_READ_RELAY_URLS - // Don't load potentially untrusted relays from local storage - const favoriteRelays: string[] = pubkey ? DEFAULT_FAVORITE_RELAYS : FAST_READ_RELAY_URLS.slice() - + /** Curated app defaults for the home feed — same for anonymous and logged-in users until kind 10012 loads. */ + const favoriteRelays: string[] = [...DEFAULT_FAVORITE_RELAYS] + if (pubkey) { // Only add stored relay sets if user is logged in const storedRelaySets = storage.getRelaySets()