feat: support for generic repost
This commit is contained in:
parent
14b3fbd496
commit
a40d7b0676
11 changed files with 92 additions and 68 deletions
|
|
@ -118,12 +118,22 @@ export function createRepostDraftEvent(event: Event): TDraftEvent {
|
|||
const isProtected = isProtectedEvent(event)
|
||||
const tags = [buildETag(event.id, event.pubkey), buildPTag(event.pubkey)]
|
||||
|
||||
if (event.kind === kinds.ShortTextNote) {
|
||||
return {
|
||||
kind: kinds.Repost,
|
||||
content: isProtected ? '' : JSON.stringify(event),
|
||||
tags,
|
||||
created_at: dayjs().unix()
|
||||
}
|
||||
}
|
||||
|
||||
tags.push(buildKTag(event.kind))
|
||||
if (isReplaceableEvent(event.kind)) {
|
||||
tags.push(buildATag(event))
|
||||
}
|
||||
|
||||
return {
|
||||
kind: kinds.Repost,
|
||||
kind: kinds.GenericRepost,
|
||||
content: isProtected ? '' : JSON.stringify(event),
|
||||
tags,
|
||||
created_at: dayjs().unix()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue