Compare commits
1 Commits
v1.5.5
...
feat/permi
Author | SHA1 | Date | |
---|---|---|---|
|
64c7581286 |
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vencord",
|
"name": "vencord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.5.5",
|
"version": "1.5.4",
|
||||||
"description": "The cutest Discord client mod",
|
"description": "The cutest Discord client mod",
|
||||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -20,6 +20,7 @@ import { Channel, User } from "discord-types/general/index.js";
|
|||||||
|
|
||||||
interface DecoratorProps {
|
interface DecoratorProps {
|
||||||
activities: any[];
|
activities: any[];
|
||||||
|
canUseAvatarDecorations: boolean;
|
||||||
channel: Channel;
|
channel: Channel;
|
||||||
/**
|
/**
|
||||||
* Only for DM members
|
* Only for DM members
|
||||||
@ -51,9 +52,9 @@ export function removeDecorator(identifier: string) {
|
|||||||
decorators.delete(identifier);
|
decorators.delete(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] {
|
export function __addDecoratorsToList(props: DecoratorProps): (JSX.Element | null)[] {
|
||||||
const isInGuild = !!(props.guildId);
|
const isInGuild = !!(props.guildId);
|
||||||
return Array.from(decorators.values(), decoratorObj => {
|
return [...decorators.values()].map(decoratorObj => {
|
||||||
const { decorator, onlyIn } = decoratorObj;
|
const { decorator, onlyIn } = decoratorObj;
|
||||||
// this can most likely be done cleaner
|
// this can most likely be done cleaner
|
||||||
if (!onlyIn || (onlyIn === "guilds" && isInGuild) || (onlyIn === "dms" && !isInGuild)) {
|
if (!onlyIn || (onlyIn === "guilds" && isInGuild) || (onlyIn === "dms" && !isInGuild)) {
|
||||||
|
@ -26,7 +26,7 @@ export default definePlugin({
|
|||||||
patches: [
|
patches: [
|
||||||
// obtain BUILT_IN_COMMANDS instance
|
// obtain BUILT_IN_COMMANDS instance
|
||||||
{
|
{
|
||||||
find: ',"tenor"',
|
find: '"giphy","tenor"',
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
// Matches BUILT_IN_COMMANDS. This is not exported so this is
|
// Matches BUILT_IN_COMMANDS. This is not exported so this is
|
||||||
@ -34,7 +34,7 @@ export default definePlugin({
|
|||||||
// patch simpler
|
// patch simpler
|
||||||
|
|
||||||
// textCommands = builtInCommands.filter(...)
|
// textCommands = builtInCommands.filter(...)
|
||||||
match: /(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,
|
match: /(?<=\w=)(\w)(\.filter\(.{0,30}giphy)/,
|
||||||
replace: "Vencord.Api.Commands._init($1)$2",
|
replace: "Vencord.Api.Commands._init($1)$2",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -22,28 +22,21 @@ import definePlugin from "@utils/types";
|
|||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "MemberListDecoratorsAPI",
|
name: "MemberListDecoratorsAPI",
|
||||||
description: "API to add decorators to member list (both in servers and DMs)",
|
description: "API to add decorators to member list (both in servers and DMs)",
|
||||||
authors: [Devs.TheSun, Devs.Ven],
|
authors: [Devs.TheSun],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "lostPermissionTooltipText,",
|
find: "lostPermissionTooltipText,",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /decorators:.{0,100}?children:\[(?<=(\i)\.lostPermissionTooltipText.+?)/,
|
match: /Fragment,{children:\[(.{30,80})\]/,
|
||||||
replace: "$&...Vencord.Api.MemberListDecorators.__getDecorators($1),"
|
replace: "Fragment,{children:Vencord.Api.MemberListDecorators.__addDecoratorsToList(this.props).concat($1)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "PrivateChannel.renderAvatar",
|
find: "PrivateChannel.renderAvatar",
|
||||||
replacement: [
|
replacement: {
|
||||||
// props are shadowed by nested props so we have to do this
|
match: /(subText:(.{1,2})\.renderSubtitle\(\).{1,50}decorators):(.{30,100}:null)/,
|
||||||
{
|
replace: "$1:Vencord.Api.MemberListDecorators.__addDecoratorsToList($2.props).concat($3)"
|
||||||
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]"
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -48,7 +48,6 @@ export default definePlugin({
|
|||||||
{
|
{
|
||||||
find: ".ADD_ROLE_A11Y_LABEL",
|
find: ".ADD_ROLE_A11Y_LABEL",
|
||||||
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
|
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
|
||||||
noWarn: true,
|
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /"dot"===\i/,
|
match: /"dot"===\i/,
|
||||||
replace: "true"
|
replace: "true"
|
||||||
@ -57,7 +56,6 @@ export default definePlugin({
|
|||||||
{
|
{
|
||||||
find: ".roleVerifiedIcon",
|
find: ".roleVerifiedIcon",
|
||||||
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
|
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
|
||||||
noWarn: true,
|
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /"dot"===\i/,
|
match: /"dot"===\i/,
|
||||||
replace: "true"
|
replace: "true"
|
||||||
|
@ -165,7 +165,7 @@ export default definePlugin({
|
|||||||
{
|
{
|
||||||
find: '"renderLinkComponent","maxWidth"',
|
find: '"renderLinkComponent","maxWidth"',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(return\(.{1,100}\(\)\.wrapper.{1,200})(src)/,
|
match: /(return\(.{1,100}\(\)\.wrapper.{1,100})(src)/,
|
||||||
replace: `$1id: '${ELEMENT_ID}',$2`
|
replace: `$1id: '${ELEMENT_ID}',$2`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -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
|
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.
|
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.
|
||||||
|
@ -50,6 +50,17 @@ export default definePlugin({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
predicate: () => settings.store.onboarding
|
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
|
settings
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "./styles.css";
|
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
@ -43,7 +41,6 @@ export default definePlugin({
|
|||||||
{tooltipProps => (
|
{tooltipProps => (
|
||||||
<div
|
<div
|
||||||
{...tooltipProps}
|
{...tooltipProps}
|
||||||
className="vc-pip-button"
|
|
||||||
role="button"
|
role="button"
|
||||||
style={{
|
style={{
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@ -74,7 +71,7 @@ export default definePlugin({
|
|||||||
>
|
>
|
||||||
<svg width="24px" height="24px" viewBox="0 0 24 24">
|
<svg width="24px" height="24px" viewBox="0 0 24 24">
|
||||||
<path
|
<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"
|
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>
|
</svg>
|
||||||
|
@ -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);
|
|
||||||
}
|
|
Reference in New Issue
Block a user