feat: add try-delete post option

This commit is contained in:
codytseng
2025-08-30 14:21:35 +08:00
parent 905ef99e0e
commit 13527a3ca7
21 changed files with 241 additions and 97 deletions

View File

@@ -416,6 +416,22 @@ export function createPollResponseDraftEvent(
}
}
export function createDeletionRequestDraftEvent(event: Event): TDraftEvent {
const tags: string[][] = [buildKTag(event.kind)]
if (isReplaceableEvent(event.kind)) {
tags.push(['a', getReplaceableCoordinateFromEvent(event)])
} else {
tags.push(['e', event.id])
}
return {
kind: kinds.EventDeletion,
content: 'Request for deletion of the event.',
tags,
created_at: dayjs().unix()
}
}
function generateImetaTags(imageUrls: string[]) {
return imageUrls
.map((imageUrl) => {