mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
Support Fixes
This commit is contained in:
parent
b4b95b1943
commit
a7a722dab9
3 changed files with 496 additions and 510 deletions
|
@ -23,7 +23,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
import { Link } from "@components/Link";
|
import { Link } from "@components/Link";
|
||||||
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
|
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
|
||||||
import { Devs, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_SUPPORT_CHANNEL_ID } from "@utils/constants";
|
import { Devs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_GUILD_ID, VC_SUPPORT_CHANNEL_ID } from "@utils/constants";
|
||||||
import { sendMessage } from "@utils/discord";
|
import { sendMessage } from "@utils/discord";
|
||||||
import { Logger } from "@utils/Logger";
|
import { Logger } from "@utils/Logger";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
|
@ -40,24 +40,17 @@ import plugins, { PluginMeta } from "~plugins";
|
||||||
|
|
||||||
import SettingsPlugin from "./settings";
|
import SettingsPlugin from "./settings";
|
||||||
|
|
||||||
const VENCORD_GUILD_ID = "1015060230222131221";
|
|
||||||
const EQUICORD_GUILD_ID = "1015060230222131221";
|
|
||||||
const VENBOT_USER_ID = "1017176847865352332";
|
const VENBOT_USER_ID = "1017176847865352332";
|
||||||
const KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
|
const KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
|
||||||
const CodeBlockRe = /```js\n(.+?)```/s;
|
const CodeBlockRe = /```js\n(.+?)```/s;
|
||||||
|
|
||||||
const AllowedChannelIds = [
|
|
||||||
SUPPORT_CHANNEL_ID,
|
|
||||||
"1173659827881390160", // Equicord > #dev
|
|
||||||
"1297590739911573585", // Equicord > #support
|
|
||||||
];
|
|
||||||
|
|
||||||
const TrustedRolesIds = [
|
const TrustedRolesIds = [
|
||||||
"1026534353167208489", // contributor
|
"1026534353167208489", // contributor
|
||||||
"1026504932959977532", // regular
|
"1026504932959977532", // regular
|
||||||
"1042507929485586532", // donor
|
"1042507929485586532", // donor
|
||||||
"1173520023239786538", // Equicord Team
|
"1173520023239786538", // Equicord Team
|
||||||
"1222677964760682556", // Equicord Contributor
|
"1222677964760682556", // Equicord Contributor
|
||||||
|
"1287079931645263968", // Equibop Contributor
|
||||||
"1173343399470964856", // Vencord Contributor
|
"1173343399470964856", // Vencord Contributor
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -165,13 +158,15 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
name: "equicord-debug",
|
name: "equicord-debug",
|
||||||
description: "Send Equicord debug info",
|
description: "Send Equicord debug info",
|
||||||
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || AllowedChannelIds.includes(ctx.channel.id),
|
// @ts-expect-error
|
||||||
|
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || GUILD_ID === ctx.guild.id,
|
||||||
execute: async () => ({ content: await generateDebugInfoMessage() })
|
execute: async () => ({ content: await generateDebugInfoMessage() })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "equicord-plugins",
|
name: "equicord-plugins",
|
||||||
description: "Send Equicord plugin list",
|
description: "Send Equicord plugin list",
|
||||||
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || AllowedChannelIds.includes(ctx.channel.id),
|
// @ts-expect-error
|
||||||
|
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || GUILD_ID === ctx.guild.id,
|
||||||
execute: () => ({ content: generatePluginList() })
|
execute: () => ({ content: generatePluginList() })
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -223,7 +218,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore outdated type
|
// @ts-ignore outdated type
|
||||||
const roles = GuildMemberStore.getSelfMember(VENCORD_GUILD_ID)?.roles || GuildMemberStore.getSelfMember(EQUICORD_GUILD_ID)?.roles;
|
const roles = GuildMemberStore.getSelfMember(VC_GUILD_ID)?.roles || GuildMemberStore.getSelfMember(GUILD_ID)?.roles;
|
||||||
if (!roles || TrustedRolesIds.some(id => roles.includes(id))) return;
|
if (!roles || TrustedRolesIds.some(id => roles.includes(id))) return;
|
||||||
|
|
||||||
if (!IS_WEB && IS_UPDATER_DISABLED) {
|
if (!IS_WEB && IS_UPDATER_DISABLED) {
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Vencord, a modification for Discord's desktop app
|
* Vencord, a Discord client mod
|
||||||
* Copyright (c) 2022 Vendicated and contributors
|
* Copyright (c) 2024 Vendicated and contributors
|
||||||
*
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "./messageLogger.css";
|
import "./messageLogger.css";
|
||||||
|
@ -52,7 +40,7 @@ import { openHistoryModal } from "./HistoryModal";
|
||||||
|
|
||||||
interface MLMessage extends Message {
|
interface MLMessage extends Message {
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
editHistory?: { timestamp: Date; content: string }[];
|
editHistory?: { timestamp: Date; content: string; }[];
|
||||||
firstEditTimestamp?: Date;
|
firstEditTimestamp?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +117,7 @@ const patchChannelContextMenu: NavContextMenuPatchCallback = (
|
||||||
{ channel },
|
{ channel },
|
||||||
) => {
|
) => {
|
||||||
const messages = MessageStore.getMessages(channel?.id) as MLMessage[];
|
const messages = MessageStore.getMessages(channel?.id) as MLMessage[];
|
||||||
if (!messages?.some((msg) => msg.deleted || msg.editHistory?.length)) return;
|
if (!messages?.some(msg => msg.deleted || msg.editHistory?.length)) return;
|
||||||
|
|
||||||
const group =
|
const group =
|
||||||
findGroupChildrenByChildId("mark-channel-read", children) ?? children;
|
findGroupChildrenByChildId("mark-channel-read", children) ?? children;
|
||||||
|
@ -139,7 +127,7 @@ const patchChannelContextMenu: NavContextMenuPatchCallback = (
|
||||||
label="Clear Message Log"
|
label="Clear Message Log"
|
||||||
color="danger"
|
color="danger"
|
||||||
action={() => {
|
action={() => {
|
||||||
messages.forEach((msg) => {
|
messages.forEach(msg => {
|
||||||
if (msg.deleted)
|
if (msg.deleted)
|
||||||
FluxDispatcher.dispatch({
|
FluxDispatcher.dispatch({
|
||||||
type: "MESSAGE_DELETE",
|
type: "MESSAGE_DELETE",
|
||||||
|
@ -203,7 +191,7 @@ export default definePlugin({
|
||||||
return (
|
return (
|
||||||
Settings.plugins.MessageLogger.inlineEdits && (
|
Settings.plugins.MessageLogger.inlineEdits && (
|
||||||
<>
|
<>
|
||||||
{message.editHistory?.map((edit) => (
|
{message.editHistory?.map(edit => (
|
||||||
<div className="messagelogger-edited">
|
<div className="messagelogger-edited">
|
||||||
{parseEditContent(edit.content, message)}
|
{parseEditContent(edit.content, message)}
|
||||||
<Timestamp
|
<Timestamp
|
||||||
|
@ -293,7 +281,7 @@ export default definePlugin({
|
||||||
|
|
||||||
handleDelete(
|
handleDelete(
|
||||||
cache: any,
|
cache: any,
|
||||||
data: { ids: string[]; id: string; mlDeleted?: boolean },
|
data: { ids: string[]; id: string; mlDeleted?: boolean; },
|
||||||
isBulk: boolean,
|
isBulk: boolean,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
@ -312,10 +300,10 @@ export default definePlugin({
|
||||||
if (shouldIgnore) {
|
if (shouldIgnore) {
|
||||||
cache = cache.remove(id);
|
cache = cache.remove(id);
|
||||||
} else {
|
} else {
|
||||||
cache = cache.update(id, (m) =>
|
cache = cache.update(id, m =>
|
||||||
m.set("deleted", true).set(
|
m.set("deleted", true).set(
|
||||||
"attachments",
|
"attachments",
|
||||||
m.attachments.map((a) => ((a.deleted = true), a)),
|
m.attachments.map(a => ((a.deleted = true), a)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,12 @@
|
||||||
|
|
||||||
export const WEBPACK_CHUNK = "webpackChunkdiscord_app";
|
export const WEBPACK_CHUNK = "webpackChunkdiscord_app";
|
||||||
export const REACT_GLOBAL = "Vencord.Webpack.Common.React";
|
export const REACT_GLOBAL = "Vencord.Webpack.Common.React";
|
||||||
export const SUPPORT_CHANNEL_ID = "1173342942858055721";
|
export const SUPPORT_CHANNEL_ID = "1297590739911573585";
|
||||||
export const SUPPORT_CHANNEL_IDS = ["1173342942858055721", "1026515880080842772"];
|
|
||||||
export const VC_SUPPORT_CHANNEL_ID = "1026515880080842772";
|
export const VC_SUPPORT_CHANNEL_ID = "1026515880080842772";
|
||||||
|
export const SUPPORT_CHANNEL_IDS = [SUPPORT_CHANNEL_ID, VC_SUPPORT_CHANNEL_ID];
|
||||||
|
export const GUILD_ID = "1173279886065029291";
|
||||||
|
export const VC_GUILD_ID = "1015060230222131221";
|
||||||
|
export const GUILD_IDS = [GUILD_ID, VC_GUILD_ID];
|
||||||
|
|
||||||
export interface Dev {
|
export interface Dev {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue