diff --git a/docs/nostr-event-schemas.md b/docs/nostr-event-schemas.md index 492f0d3b..b09dd800 100644 --- a/docs/nostr-event-schemas.md +++ b/docs/nostr-event-schemas.md @@ -147,7 +147,7 @@ import { updateWatchHistoryListWithDefaultClient } from "./nostrWatchHistoryFaca | Relay list (`NOTE_TYPES.RELAY_LIST`) | `10002` | Repeating `['r', ]` tags, optionally with a marker of `'read'` or `'write'` to scope the relay; marker omitted for read/write relays | Empty content | | View counter (`NOTE_TYPES.VIEW_EVENT`) | `WATCH_HISTORY_KIND` (default `30079`, clients also read legacy `30078`) | Canonical tag set: `['t','view']`, a pointer tag (`['e', ]` or `['a',
]`), and a stable dedupe tag `['d', ]`, with optional `['session','true']` when a session actor signs; schema overrides may append extra tags. `['video', ...]` is supported for legacy overrides only. | Optional plaintext message | | Watch history month (`NOTE_TYPES.WATCH_HISTORY_INDEX`) | `WATCH_HISTORY_KIND` (default `30079`, clients also read legacy `30078`) | Replaceable list tag `['d', `${WATCH_HISTORY_LIST_IDENTIFIER}:`]` with optional `['month', ]` marker plus schema append tags; no chunk pointers required. | JSON payload `{ version, month: 'YYYY-MM', items: [{ id: , watched_at?: }] }` | -| Subscription list (`NOTE_TYPES.SUBSCRIPTION_LIST`) | `30000` (clients also read legacy `30002`) | `['d', 'subscriptions']` | NIP-04/NIP-44 encrypted JSON array of NIP-51 follow-set tuples (e.g., `[['p', ], …]`) | +| Subscription list (`NOTE_TYPES.SUBSCRIPTION_LIST`) | `30000` | `['d', 'subscriptions']` | NIP-04/NIP-44 encrypted JSON array of NIP-51 follow-set tuples (e.g., `[['p', ], …]`) | | User block list (`NOTE_TYPES.USER_BLOCK_LIST`) | `10000` | `['d', 'user-blocks']` | NIP-04/NIP-44 encrypted JSON `{ blockedPubkeys: string[] }` | | Hashtag preferences (`NOTE_TYPES.HASHTAG_PREFERENCES`) | `30015` (reads legacy `30005`) | `['d', 'bitvid:tag-preferences']` plus schema-appended `['encrypted','nip44_v2']` | NIP-44 encrypted JSON `{ version, interests: string[], disinterests: string[] }` | | Admin moderation list (`NOTE_TYPES.ADMIN_MODERATION_LIST`) | `30000` | `['d', 'bitvid:admin:editors']`, repeated `['p', ]` entries | Empty content | @@ -158,8 +158,7 @@ Subscription lists therefore match the [NIP-51 follow-set specification](./nips/51.md#sets) by emitting kind `30000` events with the shared `['d','subscriptions']` identifier. Builders continue to encrypt the payload so individual follows stay private unless explicitly -revealed by the author. Readers still request legacy kind `30002` alongside -`30000` while older clients migrate so existing follow sets remain visible. +revealed by the author. NIP-94 compliance: mirror events now normalize the `['m', ]` tag to lowercase—covering both user input and inferred values—so they satisfy [NIP-94's lowercase MIME requirement](./nips/94.md). Related helpers reuse the same normalization to keep future publishers aligned. diff --git a/js/subscriptions.js b/js/subscriptions.js index f8e27c3a..1cc1be18 100644 --- a/js/subscriptions.js +++ b/js/subscriptions.js @@ -32,7 +32,6 @@ import nostrService from "./services/nostrService.js"; const SUBSCRIPTION_SET_KIND = getNostrEventSchema(NOTE_TYPES.SUBSCRIPTION_LIST)?.kind ?? 30000; -const LEGACY_SUBSCRIPTION_SET_KIND = 30002; function normalizeHexPubkey(value) { if (typeof value !== "string") { @@ -266,13 +265,8 @@ class SubscriptionsManager { authors.push(userPubkey); } - const subscriptionKinds = [SUBSCRIPTION_SET_KIND]; - if (!subscriptionKinds.includes(LEGACY_SUBSCRIPTION_SET_KIND)) { - subscriptionKinds.push(LEGACY_SUBSCRIPTION_SET_KIND); - } - const filter = { - kinds: subscriptionKinds, + kinds: [SUBSCRIPTION_SET_KIND], authors, "#d": [SUBSCRIPTION_LIST_IDENTIFIER], limit: 1