From 7c901b8c0638e3d839d53d65c83f8477d1b90748 Mon Sep 17 00:00:00 2001 From: tiero <3596602+tiero@users.noreply.github.com> Date: Mon, 2 Jan 2023 13:20:11 +0100 Subject: [PATCH] fix author --- src/request.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/request.ts b/src/request.ts index af64459..530e1bf 100644 --- a/src/request.ts +++ b/src/request.ts @@ -67,14 +67,17 @@ export class NostrRPC { return new Promise((resolve, reject) => { // waiting for response from remote - // TODO: reject after a timeout - let sub = this.relay.sub([ + const queries = [ { kinds: [4], - authors: [this.target], + authors: [target], '#p': [this.self.pubkey], }, - ]); + ]; + // TODO: reject after a timeout + let sub = this.relay.sub(queries); + + console.log('subscribing to', JSON.stringify(queries)); sub.on('event', async (event: Event) => { let payload; @@ -92,8 +95,7 @@ export class NostrRPC { // ignore all the events that are not NostrRPCResponse events if (!isValidResponse(payload)) return; - - console.log(`received response from nostr id: ${event.id}`, payload); + console.log(`response: nostr id: ${event.id}`, payload); // ignore all the events that are not for this request if (payload.id !== id) return;