Compare commits

..

1 Commits

Author SHA1 Message Date
Lewis Crichton
64c7581286 feat(permissionfreewill): onboarding deletion 2023-10-03 17:46:17 +01:00
10 changed files with 31 additions and 34 deletions

View File

@ -1,7 +1,7 @@
{
"name": "vencord",
"private": "true",
"version": "1.5.5",
"version": "1.5.4",
"description": "The cutest Discord client mod",
"homepage": "https://github.com/Vendicated/Vencord#readme",
"bugs": {

View File

@ -20,6 +20,7 @@ import { Channel, User } from "discord-types/general/index.js";
interface DecoratorProps {
activities: any[];
canUseAvatarDecorations: boolean;
channel: Channel;
/**
* Only for DM members
@ -51,9 +52,9 @@ export function removeDecorator(identifier: string) {
decorators.delete(identifier);
}
export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] {
export function __addDecoratorsToList(props: DecoratorProps): (JSX.Element | null)[] {
const isInGuild = !!(props.guildId);
return Array.from(decorators.values(), decoratorObj => {
return [...decorators.values()].map(decoratorObj => {
const { decorator, onlyIn } = decoratorObj;
// this can most likely be done cleaner
if (!onlyIn || (onlyIn === "guilds" && isInGuild) || (onlyIn === "dms" && !isInGuild)) {

View File

@ -26,7 +26,7 @@ export default definePlugin({
patches: [
// obtain BUILT_IN_COMMANDS instance
{
find: ',"tenor"',
find: '"giphy","tenor"',
replacement: [
{
// Matches BUILT_IN_COMMANDS. This is not exported so this is
@ -34,7 +34,7 @@ export default definePlugin({
// patch simpler
// textCommands = builtInCommands.filter(...)
match: /(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,
match: /(?<=\w=)(\w)(\.filter\(.{0,30}giphy)/,
replace: "Vencord.Api.Commands._init($1)$2",
}
],

View File

@ -22,28 +22,21 @@ import definePlugin from "@utils/types";
export default definePlugin({
name: "MemberListDecoratorsAPI",
description: "API to add decorators to member list (both in servers and DMs)",
authors: [Devs.TheSun, Devs.Ven],
authors: [Devs.TheSun],
patches: [
{
find: "lostPermissionTooltipText,",
replacement: {
match: /decorators:.{0,100}?children:\[(?<=(\i)\.lostPermissionTooltipText.+?)/,
replace: "$&...Vencord.Api.MemberListDecorators.__getDecorators($1),"
match: /Fragment,{children:\[(.{30,80})\]/,
replace: "Fragment,{children:Vencord.Api.MemberListDecorators.__addDecoratorsToList(this.props).concat($1)"
}
},
{
find: "PrivateChannel.renderAvatar",
replacement: [
// props are shadowed by nested props so we have to do this
{
match: /\i=(\i)\.applicationStream,/,
replace: "$&vencordProps=$1,"
},
{
match: /decorators:(\i\.isSystemDM\(\))\?(.+?):null/,
replace: "decorators:[...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)), $1?$2:null]"
replacement: {
match: /(subText:(.{1,2})\.renderSubtitle\(\).{1,50}decorators):(.{30,100}:null)/,
replace: "$1:Vencord.Api.MemberListDecorators.__addDecoratorsToList($2.props).concat($3)"
}
]
}
],
});

View File

@ -48,7 +48,6 @@ export default definePlugin({
{
find: ".ADD_ROLE_A11Y_LABEL",
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
noWarn: true,
replacement: {
match: /"dot"===\i/,
replace: "true"
@ -57,7 +56,6 @@ export default definePlugin({
{
find: ".roleVerifiedIcon",
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
noWarn: true,
replacement: {
match: /"dot"===\i/,
replace: "true"

View File

@ -165,7 +165,7 @@ export default definePlugin({
{
find: '"renderLinkComponent","maxWidth"',
replacement: {
match: /(return\(.{1,100}\(\)\.wrapper.{1,200})(src)/,
match: /(return\(.{1,100}\(\)\.wrapper.{1,100})(src)/,
replace: `$1id: '${ELEMENT_ID}',$2`
}
},

View File

@ -7,3 +7,8 @@ you don't want to do this") and onboarding requirements ("Making this change wil
This plugin will let you create permissions in servers that **WILL** lock you out of channels until an administrator
can resolve it for you. Please be careful with the overwrites you are making and check carefully.
## Community Server Channels
Community Server channels (i.e., `#rules` and `#moderator-only`) are actually mandatory and their existence is enforced
by the API, therefore this plugin cannot remove the restrictions behind them.

View File

@ -50,6 +50,17 @@ export default definePlugin({
}
],
predicate: () => settings.store.onboarding
},
// Onboarding deletion
{
find: "Messages.DELETE_DEFAULT_CHANNEL_BODY",
replacement: [
{
match: /if\((?=null!=\i.{5,20}Messages.DELETE_DEFAULT_CHANNEL_BODY)/,
replace: "$&false&&"
}
],
predicate: () => settings.store.onboarding
}
],
settings

View File

@ -4,8 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./styles.css";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
@ -43,7 +41,6 @@ export default definePlugin({
{tooltipProps => (
<div
{...tooltipProps}
className="vc-pip-button"
role="button"
style={{
cursor: "pointer",
@ -74,7 +71,7 @@ export default definePlugin({
>
<svg width="24px" height="24px" viewBox="0 0 24 24">
<path
fill="currentColor"
fill="var(--interactive-normal)"
d="M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"
/>
</svg>

View File

@ -1,8 +0,0 @@
.vc-pip-button {
color: var(--interactive-normal);
}
.vc-pip-button:hover {
background-color: var(--background-modifier-hover);
color: var(--interactive-hover);
}