mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-18 02:35:24 +00:00
Fix being unable to unset nicknames
Remove unwanted guild profile handler in cdn Fix rights check for bio/avatars of your own user
This commit is contained in:
@@ -65,9 +65,19 @@ router.patch(
|
||||
|
||||
if ("nick" in body) {
|
||||
permission.hasThrow("MANAGE_NICKNAMES");
|
||||
|
||||
if (!body.nick) {
|
||||
delete body.nick;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore shut up
|
||||
member.nick = null; // remove the nickname
|
||||
}
|
||||
}
|
||||
|
||||
if (("bio" in body || "avatar" in body) && member_id != "@me") {
|
||||
if (
|
||||
("bio" in body || "avatar" in body) &&
|
||||
req.params.member_id != "@me"
|
||||
) {
|
||||
const rights = await getRights(req.user_id);
|
||||
rights.hasThrow("MANAGE_USERS");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user