mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 18:07:02 -04:00
Fix SHC broken patches; Sort PermViewer channel overwrites roles (#1166)
This commit is contained in:
parent
89a6c575c9
commit
ec091a7959
4 changed files with 26 additions and 11 deletions
|
@ -26,6 +26,7 @@ import type { Channel } from "discord-types/general";
|
|||
import type { ComponentType } from "react";
|
||||
|
||||
import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "../../permissionsViewer/components/RolesAndUsersPermissions";
|
||||
import { sortPermissionOverwrites } from "../../permissionsViewer/utils";
|
||||
import { settings, VIEW_CHANNEL } from "..";
|
||||
|
||||
enum SortOrderTypes {
|
||||
|
@ -169,12 +170,12 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
|
|||
}
|
||||
|
||||
if (Settings.plugins.PermissionsViewer.enabled) {
|
||||
setPermissions(Object.values(permissionOverwrites).map(overwrite => ({
|
||||
setPermissions(sortPermissionOverwrites(Object.values(permissionOverwrites).map(overwrite => ({
|
||||
type: overwrite.type as PermissionType,
|
||||
id: overwrite.id,
|
||||
overwriteAllow: overwrite.allow,
|
||||
overwriteDeny: overwrite.deny
|
||||
})));
|
||||
})), guild_id));
|
||||
}
|
||||
}, [channelId]);
|
||||
|
||||
|
|
|
@ -107,13 +107,13 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Prevent Discord from trying to connect to hidden channels
|
||||
match: /(?=\|\|\i\.default\.selectVoiceChannel\((\i)\.id\))/,
|
||||
replace: (_, channel) => `||$self.isHiddenChannel(${channel})`
|
||||
match: /if\(!\i&&!\i(?=.{0,50}?selectVoiceChannel\((\i)\.id\))/,
|
||||
replace: (m, channel) => `${m}&&!$self.isHiddenChannel(${channel})`
|
||||
},
|
||||
{
|
||||
// Make Discord show inside the channel if clicking on a hidden or locked channel
|
||||
match: /(?<=\|\|\i\.default\.selectVoiceChannel\((\i)\.id\);!__OVERLAY__&&\()/,
|
||||
replace: (_, channel) => `$self.isHiddenChannel(${channel},true)||`
|
||||
match: /!__OVERLAY__&&\((?<=selectVoiceChannel\((\i)\.id\).+?)/,
|
||||
replace: (m, channel) => `${m}$self.isHiddenChannel(${channel},true)||`
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -195,7 +195,7 @@ export default definePlugin({
|
|||
replace: (_, pushNotificationButtonExpression, channel) => `if($self.isHiddenChannel(${channel})){${pushNotificationButtonExpression}break;}`
|
||||
},
|
||||
{
|
||||
match: /(?<=renderHeaderToolbar=function.+?case \i\.\i\.GUILD_FORUM:if\(!\i\){)(?=.+?;(.+?{channel:(\i)},"notifications"\)\)))/,
|
||||
match: /(?<=renderHeaderToolbar=function.+?case \i\.\i\.GUILD_FORUM:.+?if\(!\i\){)(?=.+?;(.+?{channel:(\i)},"notifications"\)\)))/,
|
||||
replace: (_, pushNotificationButtonExpression, channel) => `if($self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue