From 90734196e5f14b4c988b3ab36c1ab2a968e2842a Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Mon, 27 May 2024 15:56:52 +0500 Subject: [PATCH 1/2] fix: use kind 27235 in place of kind 1 wherever possible --- src/controllers/AuthController.ts | 2 +- src/utils/misc.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index 74dbbd8..b68db03 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -53,7 +53,7 @@ export class AuthController { const { hostname } = window.location const authEvent: EventTemplate = { - kind: 1, + kind: 27235, tags: [], content: `${hostname}-${timestamp}`, created_at: timestamp diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 56ba1e6..03b2fa6 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -189,7 +189,7 @@ export const signEventForMetaFile = async ( ) => { // Construct the event metadata for the meta file const event: EventTemplate = { - kind: 1, // Event type for meta file + kind: 27235, // Event type for meta file content: content, // content for event created_at: Math.floor(Date.now() / 1000), // Current timestamp tags: [] From 9bb62cf96676aa5bca5882260f037ce00c5ee74f Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Mon, 27 May 2024 15:57:40 +0500 Subject: [PATCH 2/2] fix: use kind 0 event for nostr joining block --- src/controllers/MetadataController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/MetadataController.ts b/src/controllers/MetadataController.ts index 360acc6..95b70c1 100644 --- a/src/controllers/MetadataController.ts +++ b/src/controllers/MetadataController.ts @@ -204,15 +204,15 @@ export class MetadataController { if (userRelays.length === 0) return null - // filter for finding user's first kind 1 event + // filter for finding user's first kind 0 event const eventFilter: Filter = { - kinds: [kinds.ShortTextNote], + kinds: [kinds.Metadata], authors: [hexKey] } const pool = new SimplePool() - // find user's kind 1 events published on user's relays + // find user's kind 0 events published on user's relays const events = await pool.querySync(userRelays, eventFilter) if (events && events.length) { // sort events by created_at time in ascending order