diff --git a/ROADMAP.md b/ROADMAP.md index 4346dacf..f86b5fd6 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,19 +1,13 @@ # Current -- [ ] Move blog to nostr -- [ ] Improve note rendering - - [ ] Fix reactions and replies showing up - - [x] Show all images in preview as slideshow or something - - [x] Extract nostr: links and bech32 entities, hover - - [x] Add nostr: links and bech32 entities in compose to tags - - [x] Fix extra newlines when composing -- [ ] Multiplexer - - [ ] Announce multiplextr, paravel, coracle update w/url - - [ ] Write NIP to support proxies. Update COUNT NIP to mention how proxies are a good use case for COUNT +- [ ] Look into AUTH not working for mazin +- [ ] Write NIP to support proxies. Update COUNT NIP to mention how proxies are a good use case for COUNT +- [ ] Write blog post on multiplexer +- [ ] Fix performance issues +- [ ] Fix reactions and replies showing up - [ ] Fix iOS/safari/firefox - [ ] https://github.com/coracle-social/coracle/issues/42 - [ ] Multiplex, charge past a certain usage level based on bandwidth -- [ ] Move blog to https://twitter.com/fiatjaf/status/1638514052014940162 - [ ] Add onError handler to subscriptions for when sockets fail to connect? - [ ] Add bugsnag to multiplexr diff --git a/src/agent/cmd.ts b/src/agent/cmd.ts index 13d76885..20839aca 100644 --- a/src/agent/cmd.ts +++ b/src/agent/cmd.ts @@ -180,6 +180,7 @@ class PublishableEvent { } async publish(relays, onProgress = null) { const event = await this.getSignedEvent() + //console.log(event); return const promise = pool.publish({relays, event, onProgress}) sync.processEvents(event) diff --git a/src/agent/relays.ts b/src/agent/relays.ts index 78d252b0..08485301 100644 --- a/src/agent/relays.ts +++ b/src/agent/relays.ts @@ -57,10 +57,13 @@ export const getPubkeyRelays = (pubkey, mode = null, routesOverride = null) => { let result = routesOverride || _getPubkeyRelaysCache.get(key) if (!result) { result = routes.all(filter) - _getPubkeyRelaysCache.set(key, result) + + if (result.length > 0) { + _getPubkeyRelaysCache.set(key, result) + } } - return sortByScore(map(pick(["url", "score"]), result)) + return sortByScore(map(pick(["url", "score"]), uniqByUrl(result))) } export const getPubkeyReadRelays = pubkey => getPubkeyRelays(pubkey, "read") diff --git a/src/partials/ContentEditable.svelte b/src/partials/ContentEditable.svelte index 18c137c4..480bb5b2 100644 --- a/src/partials/ContentEditable.svelte +++ b/src/partials/ContentEditable.svelte @@ -56,16 +56,11 @@ let annotations = [] for (const child of node.childNodes) { - const lineBreaks = child.querySelectorAll?.("br") || [] - if (child.tagName === "BR") { - continue + content += "\n" } - // Line breaks may be bare brs or divs wrapping brs - if (lineBreaks.length > 0) { - content += "\n".repeat(lineBreaks.length) - } else if (isLineBreak(child)) { + if (child.tagName === "DIV" && !child.querySelector("br")) { content += "\n" } diff --git a/src/routes/PersonDetail.svelte b/src/routes/PersonDetail.svelte index a906f08a..318b6501 100644 --- a/src/routes/PersonDetail.svelte +++ b/src/routes/PersonDetail.svelte @@ -31,7 +31,6 @@ const interpolate = (a, b) => t => a + Math.round((b - a) * t) const {petnamePubkeys, canPublish, mutes} = user - const getRelays = () => sampleRelays(relays.concat(getPubkeyWriteRelays(pubkey))) const tabs = ["notes", "likes", pool.forceUrls.length === 0 && "relays"].filter(identity) let pubkey = toHex(npub) @@ -44,6 +43,9 @@ let actions = [] let rgb, rgba + $: ownRelays = getPubkeyWriteRelays(pubkey) + $: relays = sampleRelays(relays.concat(ownRelays)) + $: { const color = parseHex(getThemeColor($theme, "gray-8")) @@ -101,6 +103,7 @@ // Refresh our person network.loadPeople([pubkey], {force: true}).then(() => { + ownRelays = getPubkeyWriteRelays(pubkey) person = getPersonWithFallback(pubkey) loading = false }) @@ -114,8 +117,8 @@ const followers = new Set() await network.load({ + relays, shouldProcess: false, - relays: getRelays(), filter: [{kinds: [3], "#p": [pubkey]}], onChunk: events => { for (const e of events) { @@ -143,7 +146,7 @@ } const follow = async () => { - const [{url}] = getRelays() + const [{url}] = relays user.addPetname(pubkey, url, displayPerson(person)) } @@ -244,8 +247,8 @@ {:else if activeTab === "likes"} {:else if activeTab === "relays"} - {#if getRelays().length > 0} - + {#if ownRelays.length > 0} + {:else if loading} {:else} diff --git a/src/util/html.ts b/src/util/html.ts index 52bd6473..2a89de7f 100644 --- a/src/util/html.ts +++ b/src/util/html.ts @@ -172,6 +172,10 @@ export const parseContent = content => { url = url.slice(0, -1) } + if (!url.match("://")) { + url = "https://" + url + } + push("link", urlMatch[0], url) continue } diff --git a/src/views/Settings.svelte b/src/views/Settings.svelte index 3ef414e6..1f4731c8 100644 --- a/src/views/Settings.svelte +++ b/src/views/Settings.svelte @@ -9,6 +9,7 @@ import Content from "src/partials/Content.svelte" import Heading from "src/partials/Heading.svelte" import user from "src/agent/user" + import pool from "src/agent/pool" import {toast} from "src/app/ui" let values = {...user.getSettings()} @@ -79,19 +80,21 @@ >.

-
- Multiplextr URL - - - -

- Enter a custom proxy server for multiplexing relay connections. This can drastically - improve resource usage, but has some privacy trade-offs. Leave blank to connect to relays - directly. You can find the source code here. -

-
+ {#if pool.forceUrls.length === 0} +
+ Multiplextr URL + + + +

+ Enter a custom proxy server for multiplexing relay connections. This can drastically + improve resource usage, but has some privacy trade-offs. Leave blank to connect to + relays directly. You can find the source code here. +

+
+ {/if}
Report errors and analytics diff --git a/src/views/notes/NoteContent.svelte b/src/views/notes/NoteContent.svelte index 86c42953..4769b759 100644 --- a/src/views/notes/NoteContent.svelte +++ b/src/views/notes/NoteContent.svelte @@ -22,7 +22,7 @@ const links = [] const entities = [] - const shouldTruncate = !showEntire && note.content.length > 800 + const shouldTruncate = !showEntire && note.content.length > 500 const content = parseContent(note.content) let l = 0 @@ -62,7 +62,7 @@ if (value instanceof String) { l += value.length - if (shouldTruncate && l > 400 && type !== "br") { + if (shouldTruncate && l > 350 && type !== "br") { content[i].value = value.trim() content.splice(i + 1, content.length, {type: "text", value: "..."}) break