Compare commits

..

3 Commits

Author SHA1 Message Date
b
a3c421d34a Merge pull request 'fix: use kind 27235 in place of kind 1' (#80) from issue-76 into main
All checks were successful
Release / build_and_release (push) Successful in 1m5s
Reviewed-on: https://git.sigit.io/sig/it/pulls/80
Reviewed-by: Y <yury@4gl.io>
2024-05-27 12:04:36 +00:00
SwiftHawk
9bb62cf966 fix: use kind 0 event for nostr joining block 2024-05-27 15:57:40 +05:00
SwiftHawk
90734196e5 fix: use kind 27235 in place of kind 1 wherever possible 2024-05-27 15:56:52 +05:00
3 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ export class AuthController {
const { hostname } = window.location const { hostname } = window.location
const authEvent: EventTemplate = { const authEvent: EventTemplate = {
kind: 1, kind: 27235,
tags: [], tags: [],
content: `${hostname}-${timestamp}`, content: `${hostname}-${timestamp}`,
created_at: timestamp created_at: timestamp

View File

@ -204,15 +204,15 @@ export class MetadataController {
if (userRelays.length === 0) return null 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 = { const eventFilter: Filter = {
kinds: [kinds.ShortTextNote], kinds: [kinds.Metadata],
authors: [hexKey] authors: [hexKey]
} }
const pool = new SimplePool() 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) const events = await pool.querySync(userRelays, eventFilter)
if (events && events.length) { if (events && events.length) {
// sort events by created_at time in ascending order // sort events by created_at time in ascending order

View File

@ -189,7 +189,7 @@ export const signEventForMetaFile = async (
) => { ) => {
// Construct the event metadata for the meta file // Construct the event metadata for the meta file
const event: EventTemplate = { const event: EventTemplate = {
kind: 1, // Event type for meta file kind: 27235, // Event type for meta file
content: content, // content for event content: content, // content for event
created_at: Math.floor(Date.now() / 1000), // Current timestamp created_at: Math.floor(Date.now() / 1000), // Current timestamp
tags: [] tags: []