Milestones post a card, and a dead target stops being silent
The 600-member milestone went out as plain text into the shared payments topic and Marty scrolled straight past it. Every hundred now posts a picture. The cards are pre-rendered for the whole ladder (600 through 10,000) and carry no live figures on purpose: a number baked into an image rendered weeks early is wrong by the time the mark is reached, so the numbers stay in the caption. The send falls back to plain text if the card for a mark is missing or the caption runs past Telegram's 1024. Separately: a target listed in snapshotTargets with no chat id was skipped without a word, so the "feed" half of every milestone and every daily snapshot has been going nowhere for weeks while the log said it sent. It now warns. telegramChatId is still unset, so feed is still dark until Marty says where it should point, but at least it says so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -447,7 +447,9 @@ async function boot() {
|
||||
coach.init({ dataDir: DATA_DIR, chain, accounts, mailer, ads, tank, lb: () => leaderboard, siteConfig });
|
||||
pipeline.init({ dataDir: DATA_DIR, accounts, coach, chain });
|
||||
badge.init({ publicDir: PUBLIC_DIR });
|
||||
snapshot.init({ dataDir: DATA_DIR, db, chain, siteConfig, send: async (c, t, th) => { await telegramSend(c, t, th); return true; } });
|
||||
snapshot.init({ dataDir: DATA_DIR, db, chain, siteConfig, publicDir: PUBLIC_DIR,
|
||||
send: async (c, t, th) => { await telegramSend(c, t, th); return true; },
|
||||
sendPhoto: (c, jpeg, cap, th) => telegramSendPhoto(c, jpeg, cap, th) });
|
||||
friday.init({ dataDir: DATA_DIR, siteConfig, chain, ads, accounts, mailer, drip,
|
||||
telegram: async text => { const sc = siteConfig(); if (!sc.telegramBotToken || !sc.telegramEchoChatId) return false; return telegramSend(sc.telegramEchoChatId, '\u{1F7E0} <b>InstantAdPay</b> \u00b7 ' + text, sc.telegramEchoTopicId); },
|
||||
notify: async (memberId, subject, text, kind) => { const a = await accounts.byMemberId(memberId); if (!a || !a.email) return; const html = '<p>' + String(text).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/(https:\/\/[^\s]+)/g, '<a href="$1" target="_blank" rel="noopener">$1</a>').split('\n\n').join('</p><p>').replace(/\n/g, '<br>') + '</p>'; await messages.deliver(1, ADMIN_EMAIL || 'house@instantadpay.com', [a.email], subject, html, kind || 'notice'); } });
|
||||
@@ -1189,7 +1191,15 @@ const server = http.createServer(async (req, res) => {
|
||||
const promo = promos.norm(u.searchParams.get('promo')); if (promo) set.push('iap.promo=' + promo + cookieTail); // partner code, redeemed at signup
|
||||
if (promo) { const pref = String(req.headers.referer || '').replace(/^https?:\/\//, '').split('/')[0].toLowerCase().slice(0, 80); if (pref) set.push('iap.promoref=' + encodeURIComponent(pref) + cookieTail); } // which partner page it came from
|
||||
if (ang) set.push('iap.angle=' + angle + cookieTail);
|
||||
if (!cookies['iap.ref']) set.push('iap.ref=' + encodeURIComponent(coach.refHost(req.headers.referer)) + cookieTail); // first-touch source
|
||||
// First-touch source. A PolHunter share link carries ?from=polhunter in the URL itself, which
|
||||
// survives the referrer being stripped (in-app browsers, a link pasted into chat). PolHunter
|
||||
// pays a referral bounty only for people it actually sent, so that proof has to be reliable
|
||||
// rather than dependent on a header (Marty, 2026-09-24: "not just members that come on board
|
||||
// IAP and work their way over to POL Hunter").
|
||||
if (!cookies['iap.ref']) {
|
||||
const host = u.searchParams.get('from') === 'polhunter' ? 'polhunter.com' : coach.refHost(req.headers.referer);
|
||||
set.push('iap.ref=' + encodeURIComponent(host) + cookieTail);
|
||||
}
|
||||
return serveJoinPage(res, tok, ang ? angle : '', ang, set);
|
||||
}
|
||||
// -- legacy bridge: /from/faucetwave | /from/tieroneads [?seg=advertiser]. Same squeeze page
|
||||
@@ -2246,7 +2256,9 @@ const server = http.createServer(async (req, res) => {
|
||||
// person who gets it has to be the one this member actually joined under here, not a cookie
|
||||
// PolHunter guessed at. sponsorRef is the upline's username or code, matching /join/<ref>.
|
||||
let sponsorRef = (acct && acct.sponsorRef) || '';
|
||||
const payload = JSON.stringify({ iat: Date.now(), exp: Date.now() + 5 * 60000, nonce: crypto.randomBytes(12).toString('hex'), memberId: Number(memberId), email: s.email, wallet: (acct && acct.address) || s.address || null, username: (acct && acct.username) || null, sponsorRef: sponsorRef || null, joinedAt: (acct && acct.created) || null });
|
||||
const payload = JSON.stringify({ iat: Date.now(), exp: Date.now() + 5 * 60000, nonce: crypto.randomBytes(12).toString('hex'), memberId: Number(memberId), email: s.email, wallet: (acct && acct.address) || s.address || null, username: (acct && acct.username) || null, sponsorRef: sponsorRef || null, joinedAt: (acct && acct.created) || null,
|
||||
// where they first arrived from, so PolHunter can pay a bounty only for people it sent
|
||||
joinedRef: (acct && acct.joinedRef) || null });
|
||||
const tok = b64u(payload) + '.' + b64u(crypto.createHmac('sha256', secret).update(payload).digest());
|
||||
res.writeHead(302, { Location: huntUrl + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); // the loop is closed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user