From 0ded0824a59ba75a3aba84dce61d1dc9fce61370 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 1 Oct 2022 14:25:51 +0200 Subject: [PATCH] stuff --- Plugins/EditChannels/EditChannels.plugin.js | 2 +- Plugins/EditUsers/EditUsers.plugin.js | 2 +- Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js | 4 ++-- Plugins/Translator/Translator.plugin.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 0400beacd9..f330424c8e 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -250,7 +250,7 @@ module.exports = (_ => { } processChannelEditorContainer (e) { - if (!e.instance.props.disabled && e.instance.props.channel && changedChannels[e.instance.props.channel.id] && (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && this.settings.places.chatTextarea) { + if (!e.instance.props.disabled && e.instance.props.channel && changedChannels[e.instance.props.channel.id] && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && this.settings.places.chatTextarea) { if (changedChannels[e.instance.props.channel.id].name) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `#${changedChannels[e.instance.props.channel.id].name}`); } } diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 12365832b9..af47db88bd 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -484,7 +484,7 @@ module.exports = (_ => { } processChannelEditorContainer (e) { - if (!e.instance.props.disabled && e.instance.props.channel && e.instance.props.channel.isDM() && (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) && this.settings.places.chatTextarea) { + if (!e.instance.props.disabled && e.instance.props.channel && e.instance.props.channel.isDM() && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) && this.settings.places.chatTextarea) { let user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.channel.recipients[0]); if (user) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `@${changedUsers[user.id] && changedUsers[user.id].name || user.username}`); } diff --git a/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js b/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js index f0b82b78a7..4cf3d62db8 100644 --- a/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js +++ b/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js @@ -142,7 +142,7 @@ module.exports = (_ => { } processChannelTextAreaContainer (e) { - if (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) { + if (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) { let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SlateCharacterCount"}); if (index > -1 && children[index].props.textValue && children[index].props.textValue.length > maxMessageLength && !this.isSlowDowned(e.instance.props.channel)) children[index] = BDFDB.ReactUtils.createElement("div", { className: BDFDB.disCNS.textareacharcounter + BDFDB.disCN.textareacharcountererror, @@ -157,7 +157,7 @@ module.exports = (_ => { } processChannelEditorContainer (e) { - if (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) { + if (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) { e.instance.props.uploadPromptCharacterCount = 999999999999999; BDFDB.PatchUtils.patch(this, e.instance, "handlePasteItem", {instead: e2 => { if (!e2.methodArguments[1] || e2.methodArguments[1].kind != "string") e2.callOriginalMethod(); diff --git a/Plugins/Translator/Translator.plugin.js b/Plugins/Translator/Translator.plugin.js index 3cc7cf7acd..75a8799556 100644 --- a/Plugins/Translator/Translator.plugin.js +++ b/Plugins/Translator/Translator.plugin.js @@ -676,7 +676,7 @@ module.exports = (_ => { } processChannelTextAreaButtons (e) { - if (this.settings.general.addTranslateButton && (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && !e.instance.props.disabled) { + if (this.settings.general.addTranslateButton && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && !e.instance.props.disabled) { e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(TranslateButtonComponent, { guildId: e.instance.props.channel.guild_id ? e.instance.props.channel.guild_id : "@me", channelId: e.instance.props.channel.id