forked from coracle/flotilla
Fix quote relays, add backwards compat for reading legacy messages/threads
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div class="text-sm">
|
||||
<Content {event} quoteProps={{minimal: true}} />
|
||||
<Content {event} quoteProps={{minimal: true, relays: [url]}} />
|
||||
{#if thunk}
|
||||
<ThunkStatus {thunk} class="mt-2" />
|
||||
{/if}
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
{#if isBlock(i)}
|
||||
<ContentQuote {...quoteProps} value={parsed.value} {depth} {event}>
|
||||
<div slot="note-content" let:event>
|
||||
<svelte:self {hideMedia} {event} depth={depth + 1} />
|
||||
<svelte:self {quoteProps} {hideMedia} {event} depth={depth + 1} />
|
||||
</div>
|
||||
</ContentQuote>
|
||||
{:else}
|
||||
|
||||
@@ -13,14 +13,19 @@
|
||||
export let value
|
||||
export let event
|
||||
export let depth = 0
|
||||
export let relays: string[] = []
|
||||
export let minimal = false
|
||||
|
||||
const {id, identifier, kind, pubkey, relays: relayHints = []} = value
|
||||
const addr = new Address(kind, pubkey, identifier)
|
||||
const idOrAddress = id || addr.toString()
|
||||
const relays = ctx.app.router.Quote(event, idOrAddress, relayHints).getUrls()
|
||||
const quote = deriveEvent(idOrAddress, relays)
|
||||
const entity = id ? nip19.neventEncode({id, relays}) : addr.toNaddr()
|
||||
const idOrAddress = id || new Address(kind, pubkey, identifier).toString()
|
||||
const mergedRelays = [
|
||||
...relays,
|
||||
...ctx.app.router.Quote(event, idOrAddress, relayHints).getUrls(),
|
||||
]
|
||||
const quote = deriveEvent(idOrAddress, mergedRelays)
|
||||
const entity = id
|
||||
? nip19.neventEncode({id, relays: mergedRelays})
|
||||
: new Address(kind, pubkey, identifier, mergedRelays).toNaddr()
|
||||
|
||||
const scrollToEvent = (id: string) => {
|
||||
const element = document.querySelector(`[data-event="${id}"]`) as any
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{formatTimestamp(event.created_at)}
|
||||
</p>
|
||||
{/if}
|
||||
<Content {event} expandMode="inline" />
|
||||
<Content {event} expandMode="inline" quoteProps={{relays: [url]}} />
|
||||
<div class="flex w-full flex-col items-end justify-between gap-2 sm:flex-row">
|
||||
<span class="whitespace-nowrap py-1 text-sm opacity-75">
|
||||
Posted by
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
if ($loading) return
|
||||
|
||||
const content = $editor.getText({blockSeparator: "\n"})
|
||||
const tags = [...getEditorTags($editor), tagRoom(GENERAL, url), [PROTECTED]]
|
||||
const tags = [...getEditorTags($editor), tagRoom(GENERAL, url), PROTECTED]
|
||||
|
||||
if (!content.trim()) {
|
||||
return pushToast({
|
||||
|
||||
Reference in New Issue
Block a user