mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
refactor(Webpack): more reliable patching (#2237)
This commit is contained in:
parent
0a598ae966
commit
a055b1d47b
8 changed files with 443 additions and 302 deletions
|
@ -36,6 +36,8 @@ const enum ShowMode {
|
|||
HiddenIconWithMutedStyle
|
||||
}
|
||||
|
||||
const CONNECT = 1n << 20n;
|
||||
|
||||
export const settings = definePluginSettings({
|
||||
hideUnreads: {
|
||||
description: "Hide Unreads",
|
||||
|
@ -273,12 +275,12 @@ export default definePlugin({
|
|||
{
|
||||
// Change the role permission check to CONNECT if the channel is locked
|
||||
match: /ADMINISTRATOR\)\|\|(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,
|
||||
replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`
|
||||
replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${CONNECT}n,${channel})?${permCheck}CONNECT):`
|
||||
},
|
||||
{
|
||||
// Change the permissionOverwrite check to CONNECT if the channel is locked
|
||||
match: /permissionOverwrites\[.+?\i=(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,
|
||||
replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`
|
||||
replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${CONNECT}n,${channel})?${permCheck}CONNECT):`
|
||||
},
|
||||
{
|
||||
// Include the @everyone role in the allowed roles list for Hidden Channels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue