aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/EmoteYoink.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-11-13 04:12:37 +0100
committerVendicated <vendicated@riseup.net>2022-11-13 04:12:37 +0100
commite5b23ff556d9586ee3f93ea8747a582b13bb9fbf (patch)
treeb28deda0b0af7614d814c687b995df16e71a11ae /src/plugins/EmoteYoink.tsx
parent9110d1f9bde60b92df548551d60dc2b004e7afc3 (diff)
downloadVencord-e5b23ff556d9586ee3f93ea8747a582b13bb9fbf.tar.gz
Vencord-e5b23ff556d9586ee3f93ea8747a582b13bb9fbf.tar.bz2
Vencord-e5b23ff556d9586ee3f93ea8747a582b13bb9fbf.zip
EmoteYoink: Don't depend on ReverseImageSearch whoopsie
Diffstat (limited to 'src/plugins/EmoteYoink.tsx')
-rw-r--r--src/plugins/EmoteYoink.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/EmoteYoink.tsx b/src/plugins/EmoteYoink.tsx
index d9b579b..405f383 100644
--- a/src/plugins/EmoteYoink.tsx
+++ b/src/plugins/EmoteYoink.tsx
@@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import { Settings } from "../api/settings";
import { CheckedTextInput } from "../components/CheckedTextInput";
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 definePlugin from "../utils/types";
import { filters } from "../webpack";
@@ -185,6 +186,17 @@ export default definePlugin({
replacement: {
match: /id:"open-native-link".{0,200}\(\{href:(.{0,3}),.{0,200}\},"open-native-link"\)/,
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"
}
}],