From c2ab86e80f7ae527a6df230a9defc8ac3d0890f9 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sat, 18 Dec 2021 22:42:06 +0100 Subject: [PATCH] [profiles][ban] save profile snapshots for reports and bans --- server/routes/profile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/profile.js b/server/routes/profile.js index 4fbd9688..26f26c25 100644 --- a/server/routes/profile.js +++ b/server/routes/profile.js @@ -263,8 +263,8 @@ router.post('/profile/save', handleErrorAsync(async (req, res) => { const sus = [...isSuspicious(req.body)]; if (sus.length && !await hasAutomatedReports(req.db, req.user.id)) { await req.db.get(SQL` - INSERT INTO reports (id, userId, reporterId, isAutomatic, comment, isHandled) - VALUES (${ulid()}, ${req.user.id}, null, 1, ${sus.join(', ')}, 0); + INSERT INTO reports (id, userId, reporterId, isAutomatic, comment, isHandled, snapshot) + VALUES (${ulid()}, ${req.user.id}, null, 1, ${sus.join(', ')}, 0, ${await profilesSnapshot(req.db, normalise(req.params.username))}); `); }