diff options
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index e592827..3a11c60 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -33,7 +33,7 @@ import { loadMediaIndex, saveMediaIndex, wipeMediaIndex } from '../media-cache.j import { mergeFeedWindow } from '../feed-window.js'; import { createThreadStore } from '../thread-cache.js'; import { createFeedCache, FEED_CACHE_POSTS, FEED_SEED_POSTS } from '../feed-cache.js'; -import { PUBLIC_FEED_RELAYS, popularCandidates } from '../popular-feed.js'; +import { POPULAR_RELAYS, FIREHOSE_RELAYS, popularCandidates } from '../popular-feed.js'; import { makeSearcher, resultRows, fallbackAvatar, warmSearch, punkImageUrl, punkSmallUrl, primalCache } from '../recipient-search.js'; import { getNetwork } from '../api.js'; import { decodeBolt11 } from '../ark/lightning.js'; @@ -4413,7 +4413,7 @@ export function messagesFeature(ctx) { const br = st().builtinRelays || {}; return [ { id: FOLLOWING, name: t('feedFollowingName'), follows: true, builtin: true, relays: br[FOLLOWING] || [] }, - { id: EVERYTHING, name: t('feedPopular'), follows: false, authors: [], packs: [], topics: [], all: true, curated: true, builtin: true, relays: br[EVERYTHING] || [] }, + { id: EVERYTHING, name: t('feedPopular'), follows: false, authors: [], packs: [], topics: [], all: true, curated: true, builtin: true, relays: oldPopularDefault(br[EVERYTHING]) ? [] : br[EVERYTHING] || [] }, ...st().feeds]; }; function feedDef(id = curFeedId) { @@ -4531,10 +4531,9 @@ export function messagesFeature(ctx) { // Popular relays that answer a bare "everything" query (probed 2026-09-27; // paid/search relays like nostr.wine and nostr.band answer nothing and are // left out). The firehose reads a few of them by default. - const RELAY_PICKS = ['wss://relay.coinos.io', 'wss://relay.damus.io', 'wss://nos.lol', 'wss://relay.primal.net', 'wss://relay.snort.social', + const RELAY_PICKS = ['wss://relay.coinos.io', 'wss://relay.ditto.pub', 'wss://relay.damus.io', 'wss://nos.lol', 'wss://relay.primal.net', 'wss://relay.snort.social', 'wss://nostr.mom', 'wss://nostr.bitcoiner.social', 'wss://eden.nostr.land', 'wss://nostr.land', 'wss://nostr.oxtr.dev', 'wss://relay.nostrplebs.com', 'wss://offchain.pub', 'wss://nostr21.com', 'wss://relay.nostr.net', 'wss://nostr-pub.wellorder.net']; - const FIREHOSE_RELAYS = PUBLIC_FEED_RELAYS; const normRelay = (u) => { let x = String(u || '').trim(); if (!x) return null; @@ -4584,7 +4583,7 @@ export function messagesFeature(ctx) { } } catch {} // relay path also covers snapshots with no posts in this language } - const relays = feedRelaysOr(def, FIREHOSE_RELAYS); + const relays = feedRelaysOr(def, POPULAR_RELAYS); const wide = [...new Set([...relays, ...NOTE_RELAYS])]; let until = extra.until != null && c.popUntil ? c.popUntil - 1 : undefined; let got = false; @@ -5211,8 +5210,17 @@ export function messagesFeature(ctx) { // Forget a feed's state so it is rebuilt; a fetch still in flight for the // old one lands nowhere (it would otherwise fill the orphan, not the new). const dropFeedState = (id) => { const c = feedStates.get(id); if (c) c.stopped = true; feedStates.delete(id); }; + // Popular's defaults before 2026-10-04: a list saved that matches them + // exactly was the defaults, kept by an edit, and follows the new ones. + function oldPopularDefault(list) { + const OLD_POPULAR = ['wss://relay.coinos.io', 'wss://relay.damus.io', 'wss://nos.lol', 'wss://relay.primal.net']; + return Array.isArray(list) && list.length === OLD_POPULAR.length && OLD_POPULAR.every((r) => list.includes(r)); + } function setFeedRelays(def, relays) { relays = [...new Set(relays.map(normRelay).filter(Boolean))].slice(0, 12); + // the usual list, picked by hand, is no list of one's own + const usual = usualRelays(def); + if (usual && relays.length === usual.length && usual.every((r) => relays.includes(r))) relays = []; for (const r of relays) { try { resetRelay(r); } catch {} } // chosen by hand: tried again even if it was sick if (def.builtin) { const s = st(); s.builtinRelays = { ...(s.builtinRelays || {}), [def.id]: relays }; save(s); } else if (adhocFeeds.has(def.id)) def.relays = relays; @@ -5223,7 +5231,7 @@ export function messagesFeature(ctx) { // the address bar carries the relays of a feed that came from a URL if (adhocFeeds.has(def.id) && ui.chatOpen && ui.msgView === 'feed') { try { history.replaceState(history.state, '', feedPath(def) || '/'); } catch {} } } - const usualRelays = (def) => (def.all ? FIREHOSE_RELAYS : (feedAuthors(def).length ? null : TOPIC_RELAYS)); + const usualRelays = (def) => (def.curated ? POPULAR_RELAYS : def.all ? FIREHOSE_RELAYS : (feedAuthors(def).length ? null : TOPIC_RELAYS)); function relayPanel(def) { const e = ui.feedRelayEdit; const custom = feedRelays(def); |
