From 2217fd2c80b8cb798e6652739b156dd5af9b3b73 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 20 Nov 2026 05:37:48 -0600 Subject: [PATCH] Admin credit grant: purchased:true grants at purchase grade, like InstantAdPay's (Marty 2026-11-20) Co-Authored-By: Claude Opus 5.5 --- server.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 886b23d..1ecfadf 100644 --- a/server.js +++ b/server.js @@ -2411,8 +2411,10 @@ const server = http.createServer(async (req, res) => { if (b.grantCredits !== undefined) { const n = Math.round(Number(b.grantCredits)); if (!(n > 0) || n > 100000) return json(res, 400, { error: 'Credits: a whole number from 1 to 100,000.' }); - await ads.addEarned(e, n); - console.log('admin credits', e, n, String(b.note || '').slice(0, 100)); + // purchased: true grants at purchase grade, so the credits also cover purchased-only spends (same switch as + // InstantAdPay's grant; Marty 2026-11-20, Orlando's 25,000 bonus); without it the grant is ordinary earned credits + await ads.addEarned(e, n, b.purchased === true ? { purchased: true } : undefined); + console.log('admin credits', e, n, b.purchased === true ? '(purchase grade)' : '', String(b.note || '').slice(0, 100)); } return json(res, 200, await adminMember.view(e)); }