Fix review findings: direction-bind the gossip handshake proof, whitespace-tokenize log redaction, show ranked STATS to viewers, single-pass render, code-before-message email templating

This commit is contained in:
Jean Chevronnet 2026-07-20 17:35:25 +00:00
parent 829a3916fd
commit 621bba00f2
No known key found for this signature in database
5 changed files with 92 additions and 46 deletions

View file

@ -463,9 +463,11 @@ fn push_stats(counters: &[(String, u64)], account: &str, to_nick: &str, me: &str
_ => read_stats(counters, gt, account),
};
let payload = format!("GS$ {} {} r={} p={} w={} l={} d={}", account, gt.wire(), s.rank(), s.points(), s.wins, s.losses, s.draws);
// push_stats is only called for a registered side (a_reg/b_reg), so the
// account guard in push_tag always applies here.
push_tag(me, net, to_nick, account, true, &payload, ctx);
// Ranked stats are PUBLIC leaderboard data and are also pushed to a viewer
// who queried someone ELSE (STATS <nick>), so `to_nick` is not the subject
// account — don't apply the board-state account guard here (that guard is
// only for the private mid-game board in push_one).
push_tag(me, net, to_nick, account, false, &payload, ctx);
}
}