rename pomeloEnabled to uniqueUsernames

This commit is contained in:
Puyodead1
2026-01-21 07:10:10 +01:00
committed by Rory&
parent 435e80ff57
commit 69fd55089c
7 changed files with 18 additions and 18 deletions
@@ -192,11 +192,11 @@ router.get(
if ((y.user_ids || []).includes(req.user_id)) y.me = true;
delete y.user_ids;
});
const { pomeloEnabled } = Config.get().general;
const { uniqueUsernames } = Config.get().general;
if (!x.author)
x.author = User.create({
id: "4",
discriminator: pomeloEnabled ? "0" : "0000",
discriminator: uniqueUsernames ? "0" : "0000",
username: "spacebarghost",
global_name: "Spacebar Ghost",
public_flags: 0,
+2 -2
View File
@@ -120,7 +120,7 @@ router.patch(
newToken = (await generateToken(user.id)) as string;
}
// TODO: pomelo: disallow if pomelo is enabled
// TODO: uniqueUsernames: disallow if uniqueUsernames is enabled
if (body.username) {
const check_username = body?.username?.replace(/\s/g, "").trim();
if (!check_username) {
@@ -152,7 +152,7 @@ router.patch(
}
}
// TODO: pomelo: disallow if pomelo is enabled
// TODO: uniqueUsernames: disallow if uniqueUsernames is enabled
if (body.discriminator) {
if (
await User.findOne({
+3 -3
View File
@@ -131,10 +131,10 @@ router.post(
},
}),
async (req: Request, res: Response) => {
const { pomeloEnabled } = Config.get().general;
const where = pomeloEnabled
const { uniqueUsernames } = Config.get().general;
const where = uniqueUsernames
? {
// TODO: pomelo: should we use username or add global_name property to the request?
// TODO: uniqueUsernames: should we use username or add global_name property to the request?
global_name: req.body.username,
}
: {