mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
Restore legacy subscription list compatibility
This commit is contained in:
1 parent
e496376236
commit
7db78b07f2
3 files changed
+89
-4
No files matched your search
+7
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user