From 5869fa2ce351efa485ae6547d618a216b09a47c1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 18 Oct 2026 09:48:13 -0700 Subject: A call from someone you don't follow and haven't written to no longer vanishes: it doesn't ring, but it's a missed call in your conversation with them, saying it didn't ring and why, a tap away from calling back (with the app shut, the worker notes it for the app, without a notification). A muted person's still leaves nothing. A logged call no longer counts as having written to someone. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg --- src/dm-inbox.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/dm-inbox.js') diff --git a/src/dm-inbox.js b/src/dm-inbox.js index 1a026c1..58fc72d 100644 --- a/src/dm-inbox.js +++ b/src/dm-inbox.js @@ -122,7 +122,8 @@ export function shouldNotifyDm(verdict) { // it's for, and worth ringing only as a fresh offer from someone this // account follows or talks to, and hasn't muted. Returns { offer, name, // type } to ring with, or null for anything else (a candidate, a stranger, -// a stale one, a wrap we hold no key for). +// a stale one, a wrap we hold no key for); `quiet` for a caller who +// may not ring us (not followed, not written to). export async function classifyCall(wrap, inboxes, nowS = Math.floor(Date.now() / 1000)) { for (const rec of inboxes) { if (!rec || !rec.sk) continue; @@ -133,9 +134,11 @@ export async function classifyCall(wrap, inboxes, nowS = Math.floor(Date.now() / const from = ev.pubkey; if (ev.kind !== CALL.OFFER || from === rec.pubkey || nowS - ev.created_at > RING_S) return null; if ((rec.muted || []).includes(from)) return null; - if (!(rec.follows || []).includes(from) && !(rec.known || []).includes(from)) return null; const type = (ev.tags.find((x) => x[0] === 'call-type') || [])[1] === 'video' ? 'video' : 'voice'; - return { offer: ev, name: (rec.names || {})[from] || null, type }; + // someone not followed nor written to doesn't ring — `quiet`: the app + // lists it as a call that didn't ring, next time it opens + const quiet = !(rec.follows || []).includes(from) && !(rec.rings || rec.known || []).includes(from); + return { offer: ev, name: (rec.names || {})[from] || null, type, quiet }; } return null; } -- cgit v1.2.3