EmoteYoink: Don't depend on ReverseImageSearch whoopsie

This commit is contained in:
Vendicated 2022-11-13 04:12:37 +01:00
parent 9110d1f9bd
commit e5b23ff556
No known key found for this signature in database
GPG Key ID: EC781ADFB93EFFA3

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Settings } from "../api/settings";
import { CheckedTextInput } from "../components/CheckedTextInput"; import { CheckedTextInput } from "../components/CheckedTextInput";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc"; import { lazyWebpack, makeLazy } from "../utils/misc";
import { ModalContent, ModalHeader, ModalRoot, openModal } from "../utils/modal"; import { ModalContent, ModalHeader, ModalRoot, openModal } from "../utils/modal";
import definePlugin from "../utils/types"; import definePlugin from "../utils/types";
import { filters } from "../webpack"; import { filters } from "../webpack";
@ -185,6 +186,17 @@ export default definePlugin({
replacement: { replacement: {
match: /id:"open-native-link".{0,200}\(\{href:(.{0,3}),.{0,200}\},"open-native-link"\)/, match: /id:"open-native-link".{0,200}\(\{href:(.{0,3}),.{0,200}\},"open-native-link"\)/,
replace: "$&,Vencord.Plugins.plugins.EmoteYoink.makeMenu(arguments[2])" replace: "$&,Vencord.Plugins.plugins.EmoteYoink.makeMenu(arguments[2])"
},
},
// Also copy pasted from Reverse Image Search
{
// pass the target to the open link menu so we can grab its data
find: "REMOVE_ALL_REACTIONS_CONFIRM_BODY,",
predicate: makeLazy(() => !Settings.plugins.ReverseImageSearch.enabled),
replacement: {
match: /(?<props>.).onHeightUpdate.{0,200}(.)=(.)=.\.url;.+?\(null!=\3\?\3:\2[^)]+/,
replace: "$&,$<props>.target"
} }
}], }],