mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-13 16:43:04 -04:00
ShowTimeouts->ShowHiddenThings ~show invite-disabled tooltip too (#2375)
This commit is contained in:
parent
8f73b9fd5f
commit
af67ddefa1
2 changed files with 40 additions and 3 deletions
61
src/plugins/showHiddenThings/index.ts
Normal file
61
src/plugins/showHiddenThings/index.ts
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2023 Vendicated and contributors
|
||||
*
|
||||
* 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 { definePluginSettings, migratePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
showTimeouts: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Show member timeout icons in chat.",
|
||||
default: true,
|
||||
},
|
||||
showInvitesPaused: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Show the invites paused tooltip in the server list.",
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
migratePluginSettings("ShowHiddenThings", "ShowTimeouts");
|
||||
export default definePlugin({
|
||||
name: "ShowHiddenThings",
|
||||
tags: ["ShowTimeouts", "ShowInvitesPaused"],
|
||||
description: "Displays various moderator-only elements regardless of permissions.",
|
||||
authors: [Devs.Dolfies],
|
||||
patches: [
|
||||
{
|
||||
find: "showCommunicationDisabledStyles",
|
||||
predicate: () => settings.store.showTimeouts,
|
||||
replacement: {
|
||||
match: /&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,
|
||||
replace: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
find: "useShouldShowInvitesDisabledNotif:",
|
||||
predicate: () => settings.store.showInvitesPaused,
|
||||
replacement: {
|
||||
match: /\i\.\i\.can\(\i\.Permissions.MANAGE_GUILD,\i\)/,
|
||||
replace: "true",
|
||||
},
|
||||
}
|
||||
],
|
||||
settings,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue