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:
parent
e7e3c67a77
commit
cc50ebf47b
@ -17,25 +17,25 @@
|
|||||||
API_VERSION: 9,
|
API_VERSION: 9,
|
||||||
GATEWAY_ENDPOINT: `${location.protocol === "https:" ? "wss://" : "ws://"}${location.host}`,
|
GATEWAY_ENDPOINT: `${location.protocol === "https:" ? "wss://" : "ws://"}${location.host}`,
|
||||||
WEBAPP_ENDPOINT: "",
|
WEBAPP_ENDPOINT: "",
|
||||||
CDN_HOST: `${location.hostname}`,
|
CDN_HOST: `${location.host}`,
|
||||||
ASSET_ENDPOINT: "",
|
ASSET_ENDPOINT: "",
|
||||||
MEDIA_PROXY_ENDPOINT: "https://media.discordapp.net",
|
MEDIA_PROXY_ENDPOINT: `${location.host}/media`,
|
||||||
WIDGET_ENDPOINT: `//${location.host}/widget`,
|
WIDGET_ENDPOINT: `//${location.host}/widget`,
|
||||||
INVITE_HOST: `${location.hostname}/invite`,
|
INVITE_HOST: `${location.host}/invite`,
|
||||||
GUILD_TEMPLATE_HOST: "${location.host}/template",
|
GUILD_TEMPLATE_HOST: "${location.host}/template",
|
||||||
GIFT_CODE_HOST: "${location.hostname}/gift",
|
GIFT_CODE_HOST: `${location.host}/gift`,
|
||||||
RELEASE_CHANNEL: "canary",
|
RELEASE_CHANNEL: "canary",
|
||||||
MARKETING_ENDPOINT: "//discord.com",
|
MARKETING_ENDPOINT: "//discord.com",
|
||||||
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
|
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
|
||||||
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
|
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
|
||||||
NETWORKING_ENDPOINT: "//router.discordapp.net",
|
NETWORKING_ENDPOINT: "//router.discordapp.net",
|
||||||
RTC_LATENCY_ENDPOINT: "//${location.hostname}/rtc",
|
RTC_LATENCY_ENDPOINT: `//${location.host}/rtc`,
|
||||||
ACTIVITY_APPLICATION_HOST: "discordsays.com",
|
ACTIVITY_APPLICATION_HOST: "discordsays.com",
|
||||||
PROJECT_ENV: "production",
|
PROJECT_ENV: "production",
|
||||||
REMOTE_AUTH_ENDPOINT: "//localhost:3020",
|
REMOTE_AUTH_ENDPOINT: "//localhost:3020",
|
||||||
SENTRY_TAGS: { buildId: "d5b97e42230075cb9634c419c0cf4d2f8f9ada53", buildType: "normal" },
|
SENTRY_TAGS: { buildId: "d5b97e42230075cb9634c419c0cf4d2f8f9ada53", buildType: "normal" },
|
||||||
MIGRATION_SOURCE_ORIGIN: "https://${location.hostname}",
|
MIGRATION_SOURCE_ORIGIN: `https://${location.host}`,
|
||||||
MIGRATION_DESTINATION_ORIGIN: "https://${location.hostname}",
|
MIGRATION_DESTINATION_ORIGIN: `https://${location.host}`,
|
||||||
HTML_TIMESTAMP: Date.now(),
|
HTML_TIMESTAMP: Date.now(),
|
||||||
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0"
|
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0"
|
||||||
};
|
};
|
||||||
|
@ -65,9 +65,19 @@ router.patch(
|
|||||||
|
|
||||||
if ("nick" in body) {
|
if ("nick" in body) {
|
||||||
permission.hasThrow("MANAGE_NICKNAMES");
|
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);
|
const rights = await getRights(req.user_id);
|
||||||
rights.hasThrow("MANAGE_USERS");
|
rights.hasThrow("MANAGE_USERS");
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published
|
|
||||||
by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Router } from "express";
|
|
||||||
import { getAvatar } from "./avatars";
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
// TODO: handle guild profiles
|
|
||||||
router.get("/:guild_id/users/:user_id/avatars/:hash", getAvatar);
|
|
||||||
router.get("/:guild_id/users/:user_id/banners/:hash", getAvatar);
|
|
||||||
|
|
||||||
export default router;
|
|
Loading…
x
Reference in New Issue
Block a user