Support q tags, stop reading kind 3

This commit is contained in:
Jon Staab 2024-03-01 16:44:18 -08:00
parent b33da91920
commit 36506fb296
2 changed files with 1 additions and 19 deletions

View File

@ -185,7 +185,7 @@ export const tagsFromContent = (content: string) => {
}
if (type.match(/nostr:(note|nevent)/)) {
tags.push(["e", value.id, value.relays?.[0] || "", "mention"])
tags.push(["q", value.id, value.relays?.[0] || ""])
}
if (type.match(/nostr:(nprofile|npub)/)) {

View File

@ -11,24 +11,6 @@ projections.addHandler(2, e => {
saveRelay(normalizeRelayUrl(e.content))
})
projections.addHandler(3, e => {
saveRelayPolicy(
e,
tryJson<RelayPolicy[]>(() => {
return Object.entries(JSON.parse(e.content || ""))
.filter(([url]) => isShareableRelayUrl(url))
.map(([url, conditions]) => {
// @ts-ignore
const write = ![false, "!"].includes(conditions.write)
// @ts-ignore
const read = ![false, "!"].includes(conditions.read)
return {url: normalizeRelayUrl(url), write, read}
})
}) as RelayPolicy[],
)
})
projections.addHandler(10002, e => {
saveRelayPolicy(
e,