Add support for kind 1063

This commit is contained in:
Jonathan Staab 2023-06-19 04:57:00 -07:00
parent 4234cbc0e1
commit 41a08f7167
4 changed files with 17 additions and 6 deletions

View File

@ -2,6 +2,7 @@
import NoteContentKind1 from "src/app/shared/NoteContentKind1.svelte"
import NoteContentKind1985 from "src/app/shared/NoteContentKind1985.svelte"
import NoteContentKind9802 from "src/app/shared/NoteContentKind9802.svelte"
import NoteContentKind1063 from "src/app/shared/NoteContentKind1063.svelte"
import user from "src/agent/user"
export let note
@ -15,6 +16,8 @@
<NoteContentKind1985 {note} {anchorId} {maxLength} {showEntire} />
{:else if note.kind === 9802}
<NoteContentKind9802 {note} {anchorId} {maxLength} {showEntire} {showMedia} />
{:else if note.kind === 1063}
<NoteContentKind1063 {note} {showMedia} />
{:else}
<NoteContentKind1 {note} {anchorId} {maxLength} {showEntire} {showMedia} />
{/if}

View File

@ -0,0 +1,13 @@
<script lang="ts">
import {Tags} from "src/util/nostr"
import {canDisplayUrl} from "src/util/notes"
import NoteContentLink from "src/app/shared/NoteContentLink.svelte"
export let note, showMedia
const url = Tags.from(note).getMeta("url")
</script>
{#if url}
<NoteContentLink value={{url, canDisplay: canDisplayUrl(url)}} {showMedia} />
{/if}

View File

@ -6,6 +6,7 @@ import {tryJson, avg} from "src/util/misc"
import {invoiceAmount} from "src/util/lightning"
export const noteKinds = [1, 1985, 30023, 30018, 10001, 1063, 9802]
// export const noteKinds = [1063]
export const personKinds = [0, 2, 3, 10001, 10002]
export const userKinds = personKinds.concat([10000, 30001, 30078])
export const appDataKeys = [

View File

@ -200,9 +200,3 @@ export const getLinks = parts =>
"value",
parts.filter(x => x.type === LINK && x.canDisplay)
)
export const isStandalone = (content, i) =>
!content[i - 1] ||
content[i - 1].type === NEWLINE ||
!content[i + 1] ||
content[i + 1].type === NEWLINE