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/sw-nwc.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/sw-nwc.js') diff --git a/src/sw-nwc.js b/src/sw-nwc.js index b6af6b8..f9d383e 100644 --- a/src/sw-nwc.js +++ b/src/sw-nwc.js @@ -35,6 +35,17 @@ self.addEventListener('push', (e) => { if (r.ok) ring = await classifyCall(await r.json(), await allInboxes()); } catch (err) { console.warn('[sw-call] could not open:', err && err.message); } if (!ring) return; + if (ring.quiet) { + // no ring for them; a note for the app, which lists it as a missed call + try { + const cache = await caches.open(CALL_CACHE); + const had = await cache.match('/__quiet-calls'); + const list = had ? await had.json() : []; + list.push(ring.offer); + await cache.put('/__quiet-calls', new Response(JSON.stringify(list.slice(-20)), { headers: { 'content-type': 'application/json' } })); + } catch (_) {} + return; + } try { const cache = await caches.open(CALL_CACHE); await cache.put('/__pending-call', new Response(JSON.stringify({ offer: ring.offer, at: Date.now() }), { headers: { 'content-type': 'application/json' } })); -- cgit v1.2.3