fire subscriptions.

this was broken during the negentropy stuff.

fixes https://github.com/nbd-wtf/nostr-tools/issues/517
This commit is contained in:
fiatjaf
2025-11-19 14:52:47 -03:00
parent 66cc55c7f0
commit c45e861493
3 changed files with 6 additions and 3 deletions

View File

@@ -256,6 +256,7 @@ export class AbstractRelay {
return false return false
} }
// shortcut EVENT sub
const subid = getSubscriptionId(json) const subid = getSubscriptionId(json)
if (subid) { if (subid) {
const so = this.openSubs.get(subid as string) const so = this.openSubs.get(subid as string)
@@ -411,7 +412,9 @@ export class AbstractRelay {
filters: Filter[], filters: Filter[],
params: Partial<SubscriptionParams> & { label?: string; id?: string }, params: Partial<SubscriptionParams> & { label?: string; id?: string },
): Subscription { ): Subscription {
return this.prepareSubscription(filters, params) const sub = this.prepareSubscription(filters, params)
sub.fire()
return sub
} }
public prepareSubscription( public prepareSubscription(

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nostr/tools", "name": "@nostr/tools",
"version": "2.17.3", "version": "2.17.4",
"exports": { "exports": {
".": "./index.ts", ".": "./index.ts",
"./core": "./core.ts", "./core": "./core.ts",

View File

@@ -1,7 +1,7 @@
{ {
"type": "module", "type": "module",
"name": "nostr-tools", "name": "nostr-tools",
"version": "2.17.3", "version": "2.17.4",
"description": "Tools for making a Nostr client.", "description": "Tools for making a Nostr client.",
"repository": { "repository": {
"type": "git", "type": "git",