Restore legacy subscription list compatibility

This commit is contained in:
thePR0M3TH3AN committed 2025-11-03 09:42:17 -05:00
1 parent e496376236
commit 7db78b07f2
3 files changed
+89 -4

No files matched your search

+7 -1
View File
@@ -32,6 +32,7 @@ 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") {
@@ -265,8 +266,13 @@ 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: [SUBSCRIPTION_SET_KIND],
kinds: subscriptionKinds,
authors,
"#d": [SUBSCRIPTION_LIST_IDENTIFIER],
limit: 1