fix: replies
This commit is contained in:
parent
a6c2decfe3
commit
304bbe4f01
13 changed files with 178 additions and 120 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import client from '@/services/client.service'
|
||||
import { TImageInfo } from '@/types'
|
||||
import { isBlurhashValid } from 'blurhash'
|
||||
import { nip19 } from 'nostr-tools'
|
||||
import { Event, nip19 } from 'nostr-tools'
|
||||
import { isValidPubkey } from './pubkey'
|
||||
|
||||
export function tagNameEquals(tagName: string) {
|
||||
|
|
@ -28,6 +29,11 @@ export function generateEventIdFromETag(tag: string[]) {
|
|||
}
|
||||
}
|
||||
|
||||
export function generateEventId(event: Pick<Event, 'id' | 'pubkey'>) {
|
||||
const relay = client.getEventHint(event.id)
|
||||
return nip19.neventEncode({ id: event.id, author: event.pubkey, relays: [relay] })
|
||||
}
|
||||
|
||||
export function extractImageInfoFromTag(tag: string[]): TImageInfo | null {
|
||||
if (tag[0] !== 'imeta') return null
|
||||
const urlItem = tag.find((item) => item.startsWith('url '))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue