forked from coracle/flotilla
Only protect events if the relay will authenticate with the user
This commit is contained in:
@@ -39,7 +39,12 @@
|
||||
REACTION_KINDS,
|
||||
} from "@app/state"
|
||||
import {setChecked, checked} from "@app/notifications"
|
||||
import {addRoomMembership, removeRoomMembership, prependParent} from "@app/commands"
|
||||
import {
|
||||
addRoomMembership,
|
||||
canEnforceNip70,
|
||||
removeRoomMembership,
|
||||
prependParent,
|
||||
} from "@app/commands"
|
||||
import {PROTECTED} from "@app/state"
|
||||
import {makeFeed} from "@app/requests"
|
||||
import {popKey} from "@app/implicit"
|
||||
@@ -101,9 +106,12 @@
|
||||
share = undefined
|
||||
}
|
||||
|
||||
const onSubmit = ({content, tags}: EventContent) => {
|
||||
const onSubmit = async ({content, tags}: EventContent) => {
|
||||
tags.push(["h", room])
|
||||
tags.push(PROTECTED)
|
||||
|
||||
if (await canEnforceNip70(url)) {
|
||||
tags.push(PROTECTED)
|
||||
}
|
||||
|
||||
let template = {content, tags}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
import ChannelComposeParent from "@app/components/ChannelComposeParent.svelte"
|
||||
import {userSettingValues, decodeRelay, getEventsForUrl} from "@app/state"
|
||||
import {setChecked, checked} from "@app/notifications"
|
||||
import {prependParent} from "@app/commands"
|
||||
import {prependParent, canEnforceNip70} from "@app/commands"
|
||||
import {PROTECTED, REACTION_KINDS} from "@app/state"
|
||||
import {makeFeed} from "@app/requests"
|
||||
import {popKey} from "@app/implicit"
|
||||
@@ -43,8 +43,10 @@
|
||||
share = undefined
|
||||
}
|
||||
|
||||
const onSubmit = ({content, tags}: EventContent) => {
|
||||
tags.push(PROTECTED)
|
||||
const onSubmit = async ({content, tags}: EventContent) => {
|
||||
if (await canEnforceNip70(url)) {
|
||||
tags.push(PROTECTED)
|
||||
}
|
||||
|
||||
let template = {content, tags}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user