From 0ff79b2d60cebe4f8edcafbc4ea090f92ea83365 Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 26 Sep 2026 16:39:03 -0500 Subject: [PATCH] Referral card counts only genuine PolHunter referrals brought / brought today now count members who are new to InstantAdPay AND came through a PolHunter link. Others on the sponsor's line (joined before the mission, or through another door such as the FaucetWave welcome-back page) get one plain note instead of inflating the numbers. Co-Authored-By: Claude Opus 5.5 --- lib/referrals.js | 14 ++++++++++---- public/app.html | 2 +- public/app.js | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/referrals.js b/lib/referrals.js index 667b9d4..157b9c3 100644 --- a/lib/referrals.js +++ b/lib/referrals.js @@ -222,12 +222,18 @@ function state(member) { firstBonusPol: refRows().some(p => p.ref.kind === 'first-bonus') ? 0 : Number(c.refFirstBonusPol) || 0, matchPct: Number(c.refMatchPct), matchDays: Number(c.refMatchDays), - brought: mine.length, - broughtNew: mine.filter(x => x.isNew).length, // the only ones that can ever pay - broughtToday: mine.filter(x => x.joinedAt && ctDay(x.joinedAt) === today).length, + // Only genuine PolHunter referrals count (Marty, 2026-09-26: "Otherwise the metric serves no + // purpose"). A member placed under you who joined InstantAdPay before the mission, or through + // another door (FaucetWave's welcome-back page put ahmedalbasha under #1 that morning), is not + // someone you brought, so they are never in these numbers. + brought: mine.filter(x => x.isNew).length, + broughtNew: mine.filter(x => x.isNew).length, + broughtToday: mine.filter(x => x.isNew && x.joinedAt && ctDay(x.joinedAt) === today).length, + otherSponsored: mine.filter(x => !x.isNew).length, // on your line, but not brought by PolHunter earnedPol: round4(rows.reduce((n, p) => n + p.pol, 0)), earnedTodayPol: round4(rows.filter(p => p.day === today).reduce((n, p) => n + p.pol, 0)), - people: mine.slice(0, 25), + // yours first, newest first; the rest after, so the list never leads with people who cannot pay + people: mine.slice().sort((a, b) => (b.isNew - a.isNew) || ((b.joinedAt || 0) - (a.joinedAt || 0))).slice(0, 25), pool: refPool(), }; } diff --git a/public/app.html b/public/app.html index 3924180..40ae855 100644 --- a/public/app.html +++ b/public/app.html @@ -49,6 +49,6 @@
Rewards are for completed missions, not income. The daily pool is limited; when it is spent, claims close until midnight Central. Cryptocurrency involves risk of loss.
- + diff --git a/public/app.js b/public/app.js index bd26539..5c01b20 100644 --- a/public/app.js +++ b/public/app.js @@ -52,7 +52,7 @@ const rf = board.referral; if (!rf || !rf.on) return ''; const link = (board.share && board.share.link) || ''; const today = rf.broughtToday, total = rf.brought; - const people = (rf.people || []).slice(0, 5).map(p => + const people = (rf.people || []).filter(p => p.isNew).slice(0, 5).map(p => '
' + esc(p.name) + '' + esc(p.state) + '
').join(''); return '
' + 'Best paid' @@ -64,8 +64,9 @@ + (rf.firstBonusPol ? '

\u{1F947} ' + rf.firstBonusPol + ' POL bonus, still unclaimed. It goes to the first hunter who brings someone all the way through. Nobody has yet.

' : '') + '
' + '

' + today + ' brought today ' - + '· ' + total + ' all time, ' + (rf.broughtNew || 0) + ' of them new · ' + rf.earnedPol + ' POL earned

' + + '· ' + total + ' all time · ' + rf.earnedPol + ' POL earned

' + (people ? '
' + people + '
' : '

Nobody yet. One message is all it takes.

') + + (rf.otherSponsored ? '

' + rf.otherSponsored + ' other ' + (rf.otherSponsored === 1 ? 'member' : 'members') + ' on your InstantAdPay line ' + (rf.otherSponsored === 1 ? 'is' : 'are') + ' not counted here: they joined before this mission or came in another way, not through your PolHunter link.

' : '') + '
' + '
'; }