This commit is contained in:
Mirco Wittrien 2022-09-27 20:56:31 +02:00
parent 4bc9b48270
commit 819fca7487
3 changed files with 10 additions and 17 deletions

View File

@ -69,6 +69,10 @@
},
"ApplicationAssetUtils": {
"getAssetImage": ["ApplicationAssetUtils", "getAssetImage"]
},
"ContextMenuUtils": {
"openContextMenu": ["renderLazy"],
"closeContextMenu": ["type:\"CONTEXT_MENU_CLOSE\""]
}
},
"LibraryModules": {
@ -81,18 +85,10 @@
"AppearanceSettingsUtils": {"props": ["updateLocale", "updateTheme"]},
"ApplicationAssetUtils": {"strings": ["ApplicationAssetUtils", "getAssetImage"], "exported": false, "value": "exports"},
"ArrayUtils": {"props": ["isArrayLike", "zipObject"]},
"AutocompleteOptions": {"props": ["AUTOCOMPLETE_OPTIONS"]},
"AutocompleteSentinels": {"props": ["CHANNEL_SENTINEL", "COMMAND_SENTINEL"]},
"BadgeUtils": {"props": ["getBadgeCountString", "getBadgeWidthForValue"]},
"BannerUtils": {"props": ["getUserBannerURLForContext"]},
"CategoryCollapseUtils": {"props": ["categoryCollapse", "categoryCollapseAll"]},
"ChannelIconUtils": {"props": ["getChannelIconComponent", "getChannelIconTooltipText"]},
"ChannelUtils": {"props": ["selectChannel", "selectPrivateChannel"]},
"ChatRestrictionUtils": {"props": ["applyChatRestrictions"]},
"ColorUtils": {"props": ["hex2int", "hex2rgb"]},
"ConnectionProviderUtils": {"props": ["get", "isSupported", "filter"]},
"ConnectionUtils": {"props": ["setShowActivity", "setVisibility"]},
"ContextMenuUtils": {"props": ["closeContextMenu", "openContextMenu"]},
"ContextMenuUtils": {"strings": ["renderLazy", "type:\"CONTEXT_MENU_CLOSE\""], "exported": false, "value": "exports"},
"CopyLinkUtils": {"props": ["SUPPORTS_COPY", "copy"]},
"CurrentUserStore": {"props": ["getCurrentUser"]},
"DesktopNotificationUtils": {"props": ["showNotification", "requestPermission"]},
@ -143,6 +139,7 @@
"RelationshipSuggestionUtils": {"props": ["getSuggestionCount", "getSuggestions"]},
"RelationshipUtils": {"props": ["addRelationship", "removeRelationship"]},
"RoleIconUtils": {"props": ["getRoleIconData"]},
"RTCConnectionUtils": {"props": ["getChannelId", "getGuildId", "getRTCConnectionId"]},
"SearchPageUtils": {"props": ["searchNextPage", "searchPreviousPage"]},
"SettingsUtils": {"props": ["ShowCurrentGame", "DeveloperMode"]},
"SimpleMarkdownComponents": {"strings": ["customEmoji", "emojiTooltipPosition", "timestampTooltip"]},

View File

@ -87,10 +87,6 @@ module.exports = (_ => {
onStart () {
maxMessageLength = BDFDB.LibraryModules.NitroUtils.canUseIncreasedMessageLength(BDFDB.LibraryStores.UserStore.getCurrentUser()) ? BDFDB.DiscordConstants.MAX_MESSAGE_LENGTH_PREMIUM : BDFDB.DiscordConstants.MAX_MESSAGE_LENGTH;
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.ChatRestrictionUtils, "applyChatRestrictions", {before: e => {
if (e.methodArguments[0] && e.methodArguments[0].content && !this.isSlowDowned(e.methodArguments[0].channel)) e.methodArguments[0].content = "_";
}});
BDFDB.PatchUtils.forceAllUpdates(this);
}

View File

@ -232,18 +232,18 @@ module.exports = (_ => {
color: isBright && this.settings.general.useBlackFont ? "black" : null
},
tag: role.name,
onContextMenu: role.id ? e => {this.openRoleContextMenu(e, role);} : null
onContextMenu: role.id ? event => this.openRoleContextMenu(event, role) : null
});
}
else return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MemberRole, {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN._toproleseverywheretag, BDFDB.disCN[`_toproleseverywhere${type}tag`], BDFDB.disCN._toproleseverywhererolestyle),
role: role,
onContextMenu: role.id ? e => {this.openRoleContextMenu(e, role);} : null
onContextMenu: role.id ? event => this.openRoleContextMenu(event, role) : null
});
}
openRoleContextMenu (e, role) {
BDFDB.LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
openRoleContextMenu (event, role) {
BDFDB.LibraryModules.ContextMenuUtils.openContextMenu(event, function (e) {
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("DeveloperContextMenu"), Object.assign({}, e, {id: role.id}));
});
}