Stack POL pages ON by default (Marty 2026-11-09: "Everyone's should be enabled by default"): every paid member has stackpol.com/<username>; only an explicit switch-off hides it. Promo tools copy, note and chatbot updated; my.js ?v=20261109pro3; qa/stackpro expects on by default. Pro features stay Pro-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5160,13 +5160,14 @@ const server = http.createServer(async (req, res) => {
|
||||
return json(res, 200, Object.assign(r, { status: await ads.visitStatus(s.email) }));
|
||||
}
|
||||
// -- onsite solo ads: member inbox with read rewards
|
||||
// Stack POL page switch (Marty 2026-11-09): a member opts in to a public page at stackpol.com/<username>. The list lives in
|
||||
// Stack POL page switch (Marty 2026-11-09): every member who has been paid has a public page at stackpol.com/<username> by
|
||||
// default (Marty, same day: "Everyone's should be enabled by default"); only an explicit switch-off hides it. The list lives in
|
||||
// DATA_DIR/stack-optin.json { users: { username: true|false } }; the Stack POL indexer on core reads it every 5 minutes.
|
||||
if (p === '/api/my/stackpol' && (req.method === 'GET' || req.method === 'POST')) {
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
const acct = await accounts.byEmail(s.email); const un = String((acct && acct.username) || '').toLowerCase();
|
||||
if (!un) return json(res, 400, { error: 'Pick a username first (Profile), then switch on your Stack POL page.' });
|
||||
if (!un) return json(res, 400, { error: 'Pick a username first (Profile); your Stack POL page lives at stackpol.com/your-username.' });
|
||||
const F = path.join(DATA_DIR, 'stack-optin.json'); let so = { users: {} }; try { so = JSON.parse(fs.readFileSync(F, 'utf8')); if (!so.users) so.users = {}; } catch (e) {}
|
||||
let b = {}; if (req.method === 'POST') b = await readBody(req);
|
||||
let buy = null;
|
||||
@@ -5176,7 +5177,7 @@ const server = http.createServer(async (req, res) => {
|
||||
// the indexer reads Pro owners from this same file, so the page knows who gets their LinkSpin links shown
|
||||
so.pro = so.pro || {}; const pv = gamepass.stackProView(s.email); if (pv.pro) so.pro[un] = true; else delete so.pro[un];
|
||||
if (req.method === 'POST' || !!so.pro[un] !== !!pv.pro || pv.pro) { so.updatedAt = Date.now(); const tmp = F + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(so)); fs.renameSync(tmp, F); }
|
||||
return json(res, 200, { on: !!so.users[un], username: un, url: 'https://stackpol.com/' + un, wallet: !!(acct && acct.address), pro: pv, buy });
|
||||
return json(res, 200, { on: so.users[un] !== false, username: un, url: 'https://stackpol.com/' + un, wallet: !!(acct && acct.address), pro: pv, buy });
|
||||
}
|
||||
if (p === '/api/my/inbox' && req.method === 'GET') {
|
||||
const s = await auth.fromRequest(req);
|
||||
|
||||
Reference in New Issue
Block a user