diff --git a/server.js b/server.js index 8813c65..209fa2f 100644 --- a/server.js +++ b/server.js @@ -1505,10 +1505,15 @@ async function tankReadyTick() { const clean = t => String(t || '').replace(/[<>&]/g, ''); const link = 'https://instantadpay.com/my#line'; if (r.fresh.length <= 3) { - for (const w of r.fresh) await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + (w.username ? '@' + clean(w.username) : 'A new member') + ' linked a wallet and is ready to switch on payouts. Adopt them from the holding tank in the next 24 hours: ' + link, sc.telegramEchoTopicId).catch(() => {}); + // a fresh link says so; a wallet that predates this tank visit (a dormant member returned by a sponsor) says "already + // linked" with the last sign-in, so adopters can judge (Marty 2026-10-29: the old wording read as a live member) + const seen = ms => { try { return new Date(ms).toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'America/Chicago' }); } catch (e) { return ''; } }; + for (const w of r.fresh) await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + (w.username ? '@' + clean(w.username) : 'A new member') + + (w.linkedNow ? ' linked a wallet and is ready to switch on payouts. Adopt them from the holding tank in the next 24 hours: ' + : ' is in the holding tank with a wallet already linked' + (w.lastSeen ? ' (last seen ' + seen(w.lastSeen) + ')' : '') + '. Adopt them in the next 24 hours: ') + link, sc.telegramEchoTopicId).catch(() => {}); } else { // first run after deploy (the members already linked) or a busy quarter hour: one digest, not a wall of posts const named = r.fresh.filter(w => w.username).map(w => '@' + clean(w.username)); - await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + r.fresh.length + ' members linked a wallet and are ready to switch on payouts' + (named.length ? ': ' + named.slice(0, 12).join(', ') + (named.length > 12 ? ' and ' + (named.length - 12) + ' more' : '') : '') + '. Adopt them from the holding tank in the next 24 hours: ' + link, sc.telegramEchoTopicId).catch(() => {}); + await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + r.fresh.length + ' members in the holding tank have a wallet linked and are ready to switch on payouts' + (named.length ? ': ' + named.slice(0, 12).join(', ') + (named.length > 12 ? ' and ' + (named.length - 12) + ' more' : '') : '') + '. Adopt them from the holding tank in the next 24 hours: ' + link, sc.telegramEchoTopicId).catch(() => {}); } return r; } diff --git a/tank.js b/tank.js index 0695c60..23d458a 100644 --- a/tank.js +++ b/tank.js @@ -474,7 +474,10 @@ async function readyTick() { if (await alignToNetwork(a).catch(() => null)) { aligned++; continue; } if (remoteOpen(a.email)) continue; const rec = markReady(a); - if (rec && !rec.notified) { rec.notified = clock(); fresh.push({ email: a.email, name: nameOf(a), username: a.username || null, until: rec.readyAt + READY_MS }); } + // linkedNow: the member was on the site when they became ready, so they linked the wallet just now; otherwise the + // wallet predates this tank visit (e.g. a dormant member returned by a sponsor; Marty 2026-10-29: the notice read as a + // fresh link) and the notice says so, with their last sign-in + if (rec && !rec.notified) { rec.notified = clock(); fresh.push({ email: a.email, name: nameOf(a), username: a.username || null, until: rec.readyAt + READY_MS, lastSeen: a.lastSeen || 0, linkedNow: (a.lastSeen || 0) >= rec.readyAt - 15 * 60 * 1000 }); } } RS.save(); const auto = await autoAssign();