mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 15:13:05 +00:00
Allow opting out of persisting instance bans on user delete endpoint
This commit is contained in:
1 parent
c218efb4d7
commit
7b38f93817
2 files changed
+29
-7
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user