feat: add nsfw toggle to post editor
This commit is contained in:
@@ -68,6 +68,7 @@ export async function createShortTextNoteDraftEvent(
|
||||
parentEvent?: Event
|
||||
addClientTag?: boolean
|
||||
protectedEvent?: boolean
|
||||
isNsfw?: boolean
|
||||
} = {}
|
||||
): Promise<TDraftEvent> {
|
||||
const { quoteEventIds, rootETag, parentETag } = await extractRelatedEventIds(
|
||||
@@ -103,6 +104,10 @@ export async function createShortTextNoteDraftEvent(
|
||||
tags.push(['client', 'jumble'])
|
||||
}
|
||||
|
||||
if (options.isNsfw) {
|
||||
tags.push(['content-warning', 'NSFW'])
|
||||
}
|
||||
|
||||
if (options.protectedEvent) {
|
||||
tags.push(['-'])
|
||||
}
|
||||
@@ -182,6 +187,7 @@ export async function createCommentDraftEvent(
|
||||
options: {
|
||||
addClientTag?: boolean
|
||||
protectedEvent?: boolean
|
||||
isNsfw?: boolean
|
||||
} = {}
|
||||
): Promise<TDraftEvent> {
|
||||
const {
|
||||
@@ -241,6 +247,10 @@ export async function createCommentDraftEvent(
|
||||
tags.push(['client', 'jumble'])
|
||||
}
|
||||
|
||||
if (options.isNsfw) {
|
||||
tags.push(['content-warning', 'NSFW'])
|
||||
}
|
||||
|
||||
if (options.protectedEvent) {
|
||||
tags.push(['-'])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user