diff --git a/package-lock.json b/package-lock.json index 393081a0..9c193b2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "imwald", - "version": "23.9.2", + "version": "23.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "imwald", - "version": "23.9.2", + "version": "23.10.0", "license": "MIT", "dependencies": { "@asciidoctor/core": "^3.0.4", diff --git a/package.json b/package.json index 1a2fb41f..4535eb80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "imwald", - "version": "23.9.2", + "version": "23.10.0", "description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery", "private": true, "type": "module", diff --git a/src/components/Note/Highlight/index.tsx b/src/components/Note/Highlight/index.tsx index 58e46e33..3499117c 100644 --- a/src/components/Note/Highlight/index.tsx +++ b/src/components/Note/Highlight/index.tsx @@ -282,7 +282,6 @@ export default function Highlight({ ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO, ExtendedKind.VIDEO_ADDRESSABLE, - ExtendedKind.SHORT_VIDEO_ADDRESSABLE, // NIP-71 addressable; same VideoNotePreview path as 21/22 ExtendedKind.PICTURE, // Has PictureNotePreview ExtendedKind.PUBLICATION, // Has PublicationCard ExtendedKind.WIKI_ARTICLE, // Has special card diff --git a/src/components/WebPreview/index.tsx b/src/components/WebPreview/index.tsx index fed9a3f9..5e065221 100644 --- a/src/components/WebPreview/index.tsx +++ b/src/components/WebPreview/index.tsx @@ -37,7 +37,6 @@ function getEventTypeName(kind: number): string { case ExtendedKind.VIDEO_ADDRESSABLE: return 'Video' case ExtendedKind.SHORT_VIDEO: - case ExtendedKind.SHORT_VIDEO_ADDRESSABLE: return 'Short Video' case ExtendedKind.POLL: return 'Poll' diff --git a/src/constants.ts b/src/constants.ts index 7ed55e51..5a6ccd9e 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -515,8 +515,6 @@ export const ExtendedKind = { SHORT_VIDEO: 22, /** NIP-71: addressable normal video (same rendering as {@link ExtendedKind.VIDEO}). */ VIDEO_ADDRESSABLE: 34235, - /** NIP-71: addressable short video (same rendering as {@link ExtendedKind.SHORT_VIDEO}). */ - SHORT_VIDEO_ADDRESSABLE: 34236, POLL: 1068, /** NIP-B9 zap poll (paid votes via zaps). */ ZAP_POLL: 6969, @@ -602,12 +600,11 @@ export function isUnsignedExperimentalKind(kind: number): boolean { return kind >= UNSIGNED_EXPERIMENTAL_KIND_MIN && kind <= UNSIGNED_EXPERIMENTAL_KIND_MAX } -/** NIP-71 regular + addressable video kinds (21, 22, 34235, 34236). */ +/** NIP-71 regular + addressable video kinds (21, 22, 34235). Kind 34236 is not supported. */ export const NIP71_VIDEO_KINDS: readonly number[] = [ ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO, - ExtendedKind.VIDEO_ADDRESSABLE, - ExtendedKind.SHORT_VIDEO_ADDRESSABLE + ExtendedKind.VIDEO_ADDRESSABLE ] const NIP71_VIDEO_KIND_SET = new Set(NIP71_VIDEO_KINDS) @@ -628,9 +625,9 @@ export function isNip71StyleVideoKind(kind: number): boolean { */ export const AUTHOR_CORE_PREFETCH_ON_INGEST_KINDS: ReadonlySet = new Set() -/** Short-form portrait-style bucket (kind 22 or 34236). */ +/** Short-form portrait-style bucket (kind 22 only; addressable 34236 is not supported). */ export function isNip71ShortVideoKind(kind: number): boolean { - return kind === ExtendedKind.SHORT_VIDEO || kind === ExtendedKind.SHORT_VIDEO_ADDRESSABLE + return kind === ExtendedKind.SHORT_VIDEO } /** Max kind for signed “custom event” notes in the generic composer (below the unsigned experimental range). */ @@ -837,7 +834,6 @@ export const SUPPORTED_KINDS = [ ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO, ExtendedKind.VIDEO_ADDRESSABLE, - ExtendedKind.SHORT_VIDEO_ADDRESSABLE, ExtendedKind.POLL, ExtendedKind.ZAP_POLL, ExtendedKind.COMMENT, diff --git a/src/lib/draft-event.ts b/src/lib/draft-event.ts index 959d1342..09b5cee5 100644 --- a/src/lib/draft-event.ts +++ b/src/lib/draft-event.ts @@ -1964,7 +1964,7 @@ export async function createVideoDraftEvent( content: string, imetaTags: string[][], mentions: string[], - videoKind: number, // 21, 22, 34235, or 34236 (NIP-71) + videoKind: number, // 21, 22, or 34235 (NIP-71) options: { title?: string addClientTag?: boolean @@ -2002,7 +2002,7 @@ export async function createVideoDraftEvent( } return setDraftEventCache({ - kind: videoKind, // ExtendedKind.VIDEO or ExtendedKind.SHORT_VIDEO + kind: videoKind, // NIP-71: 21, 22, or 34235 content: transformedEmojisContent, tags }) diff --git a/src/lib/event-ingest-filter.ts b/src/lib/event-ingest-filter.ts index ddf9dfe2..a1e7bde1 100644 --- a/src/lib/event-ingest-filter.ts +++ b/src/lib/event-ingest-filter.ts @@ -56,6 +56,9 @@ function explicitLookupMatchesEvent(eventId: string, lookup?: string): boolean { return eventId.toLowerCase() === l } +/** NIP-71 addressable short video — dropped site-wide (relay spam). */ +const DEPRECATED_NIP71_SHORT_VIDEO_ADDRESSABLE_KIND = 34236 + /** * Single gate for subscribe/cache/IDB read paths: drop kind-1 JSON-object spam, Kacti broadcast spam, * and malformed relay reviews. Optional {@link ShouldDropEventOnIngestOptions} relaxes Kacti drops for explicit id fetch. @@ -64,6 +67,7 @@ export function shouldDropEventOnIngest( event: NEvent, options?: ShouldDropEventOnIngestOptions ): boolean { + if (event.kind === DEPRECATED_NIP71_SHORT_VIDEO_ADDRESSABLE_KIND) return true if (isIncompleteRelayReviewIngest(event)) return true if (isStringifiedJsonObjectContentNostrEvent(event)) return true if (isKactiBroadcastSpamKind1(event)) { diff --git a/src/lib/kind-description.ts b/src/lib/kind-description.ts index 0f1c8eda..17d6add7 100644 --- a/src/lib/kind-description.ts +++ b/src/lib/kind-description.ts @@ -38,8 +38,6 @@ export function getKindDescription( return { number: 22, description: 'Short Video Note' } case ExtendedKind.VIDEO_ADDRESSABLE: return { number: 34235, description: 'Video Note (addressable)' } - case ExtendedKind.SHORT_VIDEO_ADDRESSABLE: - return { number: 34236, description: 'Short Video Note (addressable)' } case kinds.LongFormArticle: return { number: 30023, description: 'Long-form Article' } case ExtendedKind.WIKI_ARTICLE: diff --git a/src/lib/wisp-trending-relay.ts b/src/lib/wisp-trending-relay.ts index a65fcc66..8ac91955 100644 --- a/src/lib/wisp-trending-relay.ts +++ b/src/lib/wisp-trending-relay.ts @@ -27,8 +27,7 @@ export const WISP_TRENDING_FEED_KINDS: readonly number[] = [ ExtendedKind.PICTURE, ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO, - ExtendedKind.VIDEO_ADDRESSABLE, - ExtendedKind.SHORT_VIDEO_ADDRESSABLE + ExtendedKind.VIDEO_ADDRESSABLE ] /** True when `url` is any nostrarchives notes trending WebSocket feed (path `/notes/trending/...`). */ diff --git a/src/pages/secondary/NotePage/index.tsx b/src/pages/secondary/NotePage/index.tsx index 8f6084d9..5b126389 100644 --- a/src/pages/secondary/NotePage/index.tsx +++ b/src/pages/secondary/NotePage/index.tsx @@ -60,7 +60,6 @@ function getEventTypeName(kind: number): string { case ExtendedKind.VIDEO_ADDRESSABLE: return 'Video' case ExtendedKind.SHORT_VIDEO: - case ExtendedKind.SHORT_VIDEO_ADDRESSABLE: return 'Short Video' case ExtendedKind.POLL: return 'Poll' @@ -237,7 +236,6 @@ const NotePage = forwardRef(({ id, index, hideTitlebar = false, initialEvent }: case 34235: // ExtendedKind.VIDEO_ADDRESSABLE (NIP-71) return 'Note: Video' case 22: // ExtendedKind.SHORT_VIDEO - case 34236: // ExtendedKind.SHORT_VIDEO_ADDRESSABLE (NIP-71) return 'Note: Short Video' case 11: // ExtendedKind.DISCUSSION return 'Discussions' diff --git a/src/services/local-storage.service.ts b/src/services/local-storage.service.ts index 55911bcf..8e8fb500 100644 --- a/src/services/local-storage.service.ts +++ b/src/services/local-storage.service.ts @@ -335,7 +335,7 @@ class LocalStorageService { } } if (showKindsVersion < 13) { - // NIP-71 addressable video (34235 / 34236): add when user already had regular video kinds enabled. + // NIP-71 addressable normal video (34235): add when user already had regular video kinds enabled. if ( showKinds.includes(ExtendedKind.VIDEO) || showKinds.includes(ExtendedKind.SHORT_VIDEO) @@ -343,8 +343,14 @@ class LocalStorageService { if (!showKinds.includes(ExtendedKind.VIDEO_ADDRESSABLE)) { showKinds.push(ExtendedKind.VIDEO_ADDRESSABLE) } - if (!showKinds.includes(ExtendedKind.SHORT_VIDEO_ADDRESSABLE)) { - showKinds.push(ExtendedKind.SHORT_VIDEO_ADDRESSABLE) + } + } + if (showKindsVersion < 14) { + // Kind 34236 (NIP-71 addressable short video) removed from the app — strip from saved filters. + const deprecatedShortVideoAddressable = 34236 + for (let i = showKinds.length - 1; i >= 0; i--) { + if (showKinds[i] === deprecatedShortVideoAddressable) { + showKinds.splice(i, 1) } } } @@ -354,7 +360,7 @@ class LocalStorageService { // keys cleared), persisting would write DEFAULT_FEED_SHOW_KINDS to IndexedDB and wipe the user's // saved filter before initAsync/applySettings runs. this.persistSetting(StorageKey.SHOW_KINDS, JSON.stringify(this.showKinds)) - this.persistSetting(StorageKey.SHOW_KINDS_VERSION, '13') + this.persistSetting(StorageKey.SHOW_KINDS_VERSION, '14') } // Feed filter: kind 1 OPs, kind 1 replies, kind 1111 (migrate from legacy showRepliesAndComments if set) diff --git a/src/services/mention-event-search.service.ts b/src/services/mention-event-search.service.ts index ae877e9b..ffb5b6fa 100644 --- a/src/services/mention-event-search.service.ts +++ b/src/services/mention-event-search.service.ts @@ -147,7 +147,7 @@ const PICKER_FULLTEXT_DB_CAP = 260 /** * Search for events: session cache → IndexedDB (publication + archive + cross-store full text) → relays. * Merges and dedupes by event id, up to limit. - * @param mode - 'nevent' uses NEVENT_KINDS (incl. NIP-71 video 21/22/34235/34236), 'naddr' uses NADDR_KINDS (30023,30817,30818,30040). + * @param mode - 'nevent' uses NEVENT_KINDS (incl. NIP-71 video 21/22/34235), 'naddr' uses NADDR_KINDS (30023,30817,30818,30040). * @param kindFilter - When set, only these kinds are searched (overrides `mode` for the kinds list). */ export async function searchEventsForPicker( diff --git a/src/services/nip89.service.ts b/src/services/nip89.service.ts index ed8aadcb..e9e6492c 100644 --- a/src/services/nip89.service.ts +++ b/src/services/nip89.service.ts @@ -220,7 +220,6 @@ class Nip89Service { ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO, ExtendedKind.VIDEO_ADDRESSABLE, - ExtendedKind.SHORT_VIDEO_ADDRESSABLE, ExtendedKind.POLL, ExtendedKind.COMMENT, ExtendedKind.VOICE,