aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-12 23:29:24 -0700
committerAdam Soltys <[email protected]>2026-11-12 23:29:24 -0700
commit5dad3fed20be40eaaeb8e7373dd005f61b3e5c8b (patch)
tree4c356ca35093b33d3252b5b8897ca43f2b5aff72 /src/features/messages.js
parent5026227de10e424f590d2a042e5a8770266a6b5e (diff)
downloadcoinosv3-5dad3fed20be40eaaeb8e7373dd005f61b3e5c8b.tar.gz
coinosv3-5dad3fed20be40eaaeb8e7373dd005f61b3e5c8b.zip
Relay groups with nothing said wait at the bottom of Messages, and a dead relay says so. "They shouldn't be at the top if they have 0 members and no recent activity" (Adam, 2026-11-12), of four groups.0xchat.com groups that came in on his kind 10009 list (saved by Armada) and topped the phone's list. A group's place was its last message, else the moment this device first recorded it, so a list adoption counted as brand new. Now a relay group without messages sorts by when it was joined on this device (joinedAt, set by Join) and one that only arrived on the list sorts last. groups.0xchat.com no longer resolves: a group whose relay can't be reached and that has shown nothing reads "<host> isn't answering" on its row ("On <host>" while it is still quiet) instead of "0 members"; the mark clears with the relay's first event and on every start. nip29-group-test joins gone.invalid'deadgroup on the second device and reads the row
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 85b44f3..d5c7943 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -17651,7 +17651,10 @@ export function messagesFeature(ctx) {
// one list, newest first: a group chat is a conversation like any other
const chatRows = [
...dmRows.map((x) => ({ at: x.last.rumor.created_at, dm: x })),
- ...wnGroups().filter((g) => !g.fresh).map((g) => ({ at: (wnFold(g).rows.at(-1) || {}).rumor?.created_at || g.at, g })),
+ // a relay group with nothing said yet sorts by when it was joined
+ // HERE: one that only arrived on the 10009 list (joined elsewhere,
+ // maybe years ago, maybe on a relay long gone) waits at the bottom
+ ...wnGroups().filter((g) => !g.fresh).map((g) => ({ at: (wnFold(g).rows.at(-1) || {}).rumor?.created_at || (g.nip29 ? g.joinedAt || 0 : g.at), g })),
].sort((a, b) => b.at - a.at);
const shownDms = ui.msgAllDms ? chatRows : chatRows.slice(0, LIST_PREVIEW);
kids.push(
@@ -18118,6 +18121,7 @@ export function messagesFeature(ctx) {
h('div', { class: 'muted small chat-preview' },
g.removed ? t('msgGroupGone')
: last ? (last.mine ? t('msgYouPrefix') : displayName(last.rumor.pubkey) + ':') + ' ' + (last.rumor.content || '📎 ' + t('msgGroupAttachment'))
+ : g.nip29 && !wn.accounts(g).length ? t(g.unreachable ? 'msgNip29Unreachable' : 'msgNip29Waiting', { host: g.relay.replace(/^wss?:\/\//, '').replace(/\/$/, '') })
: t('msgMembers', { n: wn.accounts(g).length }))),
unread ? h('i', { class: 'thread-dot' }) : null);
}