Allow opting out of persisting instance bans on user delete endpoint

This commit is contained in:
Rory& committed 2025-12-16 04:59:13 +01:00
1 parent c218efb4d7
commit 7b38f93817
2 files changed
+29 -7

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ router.post(
select: [...PrivateUserProjection, "data"],
});
if (!(await InstanceBan.findOne({ where: { user_id: user.id } })))
if ((body?.persistInstanceBan ?? true) && !(await InstanceBan.findOne({ where: { user_id: user.id } })))
await InstanceBan.create({ user_id: user.id, reason: body?.reason ?? "<legacy instance ban API - no reason specified>" }).save();
// prevent bugginess with clients - delete all DMs, only having half of the conversation is quite useless anyhow