This commit is contained in:
Mirco Wittrien 2022-04-22 18:02:05 +02:00
parent 77cb316d8a
commit 6a57b9402f
4 changed files with 39 additions and 10 deletions

View File

@ -190,7 +190,7 @@
"ContextMenuSubItemsMap": {
"UserContextMenu": {
"keys": ["user", "channel"],
"items": ["useHideNoVideoParticipantsItem", "useHideSelfVideoItem", "usePreviewVideoItem", "useChangeIdentityItem", "useMoveToAudienceItem", "useAddFriendNicknameItem", "useAddNoteItem", "useBlockUserItem", "useUserRelationshipItems", "useUserManagementItems", "useCallUserItem", "useFocusVideoItem", "useInviteUserToGuildItems", "useMentionUserItem", "useMessageUserItem", "useUserProfileItem", "useUserRolesItems", "useUserVolumeItem", "useWatchStreamItem", "useCloseDMItem", "useMuteChannelItem"]
"items": ["useHideNoVideoParticipantsItem", "useHideSelfVideoItem", "usePreviewVideoItem", "useChangeIdentityItem", "useMoveToAudienceItem", "useAddFriendNicknameItem", "useAddNoteItem", "useBlockUserItem", "useUserRelationshipItems", "useUserManagementItems", "useMoveUserVoiceItems", "useCallUserItem", "useFocusVideoItem", "useInviteUserToGuildItems", "useMentionUserItem", "useMessageUserItem", "useUserProfileItem", "useUserRolesItems", "useUserVolumeItem", "useWatchStreamItem", "useCloseDMItem", "useMuteChannelItem"]
}
},
"PatchTypes": [

View File

@ -921,8 +921,8 @@ img:not([src]), img[src=""], img[src="null"] {
color: var(--interactive-active);
}
[REPLACE_CLASS_input][REPLACE_CLASS_inputsuccess],
[REPLACE_CLASS_input][REPLACE_CLASS_inputerror] {
input[REPLACE_CLASS_input][REPLACE_CLASS_inputsuccess],
input[REPLACE_CLASS_input][REPLACE_CLASS_inputerror] {
border-style: solid;
border-width: 1px;
}

View File

@ -2,7 +2,7 @@
* @name ShowHiddenChannels
* @author DevilBro
* @authorId 278543574059057154
* @version 3.0.8
* @version 3.0.9
* @description Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "ShowHiddenChannels",
"author": "DevilBro",
"version": "3.0.8",
"version": "3.0.9",
"description": "Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)"
}
};
@ -193,10 +193,12 @@ module.exports = (_ => {
Channels: "render",
ChannelCategoryItem: "type",
ChannelItem: "default",
VoiceUser: "render",
VoiceUsers: "render"
},
after: {
ChannelItem: "default"
ChannelItem: "default",
VoiceUser: "render"
}
};
@ -351,6 +353,10 @@ module.exports = (_ => {
BDFDB.ChannelUtils.rerenderAll();
}
onUserContextMenu (e) {
if ((e.subType == "useUserManagementItems" || e.subType == "useMoveUserVoiceItems" || e.subType == "usePreviewVideoItem") && e.arguments[2] && this.isChannelHidden(e.arguments[2])) return null;
}
onChannelContextMenu (e) {
if (e.instance.props.channel) {
if (e.instance.props.channel.id.endsWith("hidden") && e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY) {
@ -376,6 +382,10 @@ module.exports = (_ => {
}));
}
let isHidden = this.isChannelHidden(e.instance.props.channel.id);
if (isHidden) {
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "invite-people"});
if (index > -1) children.splice(index, 1);
}
if (isHidden || this.settings.general.showForNormal) {
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-channel-read", group: true});
children.splice(index > -1 ? index + 1 : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
@ -502,12 +512,12 @@ module.exports = (_ => {
if (!(e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE && e.instance.props.connected)) {
let wrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelwrapper]]});
if (wrapper) {
wrapper.props.onMouseDown = _ => {};
wrapper.props.onMouseUp = _ => {};
wrapper.props.onMouseDown = event => BDFDB.ListenerUtils.stopEvent(event);
wrapper.props.onMouseUp = event => BDFDB.ListenerUtils.stopEvent(event);
}
let mainContent = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelmaincontent]]});
if (mainContent) {
mainContent.props.onClick = _ => {};
mainContent.props.onClick = event => BDFDB.ListenerUtils.stopEvent(event);
mainContent.props.href = null;
}
}
@ -518,6 +528,25 @@ module.exports = (_ => {
processVoiceUsers (e) {
if (!this.settings.general.showVoiceUsers && this.isChannelHidden(e.instance.props.channel.id)) e.instance.props.voiceStates = [];
}
processVoiceUser (e) {
let channelId = (BDFDB.LibraryModules.VoiceUtils.getVoiceStateForUser(e.instance.props.user.id) || {}).channelId;
if (channelId && this.isChannelHidden(channelId)) {
if (!e.returnvalue) {
e.instance.props.onClick = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onDoubleClick = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onMouseDown = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onMouseUp = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onKeyDown = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onKeyUp = event => BDFDB.ListenerUtils.stopEvent(event);
e.instance.props.onKeyPress = event => BDFDB.ListenerUtils.stopEvent(event);
}
else {
let icons = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voiceicons]]});
if (icons) icons.props.children = [];
}
}
}
isChannelHidden (channelId) {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(channelId);

View File

@ -2187,7 +2187,7 @@ a.metadataName-1KMZtB {
/* ---- 12.3. INPUTS ---- */
.input-2g-os5 { /* textinput */
input.input-2g-os5 { /* textinput */
border: 1px solid var(--deprecated-text-input-border);
}
.input-2g-os5:hover {