mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 15:22:43 +00:00
pretend self-bans don't exist in the views too
This commit is contained in:
1 parent
fd5c5d5d51
commit
6a67f50c39
1 file changed
+4
-1
@@ -35,11 +35,14 @@ router.get("/", route({ permission: "BAN_MEMBERS" }), async (req: Request, res:
|
||||
let bans = await Ban.find({ guild_id: guild_id });
|
||||
|
||||
/* Filter secret from database registry.*/
|
||||
|
||||
bans.filter(ban => ban.user_id !== ban.executor_id);
|
||||
// pretend self-bans don't exist to prevent victim chasing
|
||||
|
||||
bans.forEach((registry: BanRegistrySchema) => {
|
||||
delete registry.ip;
|
||||
});
|
||||
|
||||
|
||||
return res.json(bans);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user