Compare commits

..

744 commits

Author SHA1 Message Date
Nuckyz 7fcd9c3f06
why 2024-08-24 04:35:16 -03:00
Nuckyz 8bfacc139a
Clarify mapMangledModule can be used for primitive values 2024-08-24 02:34:50 -03:00
Nuckyz a9a8c338a6
token not required anymore 2024-08-23 20:26:37 -03:00
Nuckyz 262319a97c
who cares about logging in :) 2024-08-23 20:26:03 -03:00
Nuckyz 0379beb0ba
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-23 20:11:44 -03:00
Nuckyz 13ada86934
Ignore another useless error 2024-08-23 19:10:06 -03:00
Nuckyz fae5f9bfab
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-23 19:06:45 -03:00
Nuckyz 7d4fc5e8e1
more cleanie 2024-08-23 05:11:07 -03:00
Nuckyz 26a71caced
minor cleanup 2024-08-23 04:55:09 -03:00
Nuckyz b1ad0a0d58
Clarify loading of chunksLeft 2024-08-23 03:35:06 -03:00
Nuckyz 4a9f258e34
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-23 03:09:04 -03:00
Nuckyz 301b0e7dfc
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-22 19:56:04 -03:00
Nuckyz 2f806dde95
of course I forgot this 2024-08-20 17:04:38 -03:00
Nuckyz 30ef53403b
Make findModuleFactory reporter testable 2024-08-20 16:58:10 -03:00
Nuckyz ade9a523ac
Merge branch 'dev2' into immediate-finds-modules-proxy 2024-08-20 04:15:02 -03:00
Nuckyz 464dddff13
Only add ifs if IS_DEV 2024-08-20 04:09:39 -03:00
Nuckyz e8965866e6
Restore with value instead of getter/setter 2024-08-20 04:06:47 -03:00
Nuckyz e3d9b2001f
Fix persisting $$vencordPatchedSource when a module is loaded again 2024-08-20 03:56:59 -03:00
Nuckyz e4bc7f2add
Merge branch 'dev' into immediate-finds 2024-08-18 17:16:31 -03:00
Nuckyz edc87ac75e
fix for real now 2024-08-18 17:10:55 -03:00
Nuckyz 5c7773c7bb
apply suggestion and fix bug 2024-08-18 17:00:34 -03:00
Nuckyz 3546632bbf
Remove dead workaround 2024-08-18 01:19:34 -03:00
Nuckyz 9a48454a9f
better like this 2024-08-18 01:13:33 -03:00
Nuckyz 0e2c0b9bfb
Cleanup extractAndLoadChunksLazy error handling 2024-08-18 01:09:54 -03:00
Nuckyz 84c78a4262
Deprecate more unused apis 2024-08-18 01:02:58 -03:00
Nuckyz cfbe4affc0
Merge branch 'dev2' into immediate-finds-modules-proxy 2024-08-18 00:52:31 -03:00
Nuckyz e8f017b15e
bruh 2024-08-18 00:30:43 -03:00
Nuckyz 22a81ab142
Merge branch 'dev2' into immediate-finds-modules-proxy 2024-08-18 00:28:42 -03:00
Nuckyz 93d450a600
Make it dev only 2024-08-18 00:24:21 -03:00
Nuckyz 50bb6d867b
Add $$vencordPatchedSource 2024-08-18 00:22:02 -03:00
Nuckyz 6cc2f53501
Merge branch 'dev2' into immediate-finds-modules-proxy 2024-08-17 01:32:40 -03:00
Nuckyz f9776ce1ae
NoTrack: Fix another issue related to proxies 2024-08-14 19:41:31 -03:00
Nuckyz 18c5ca216c
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-14 19:40:21 -03:00
Nuckyz 3f0d915c75
NoTrack: Fix on encoded assets 2024-08-14 19:25:59 -03:00
Nuckyz a8f77a12df
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-13 01:53:44 -03:00
Nuckyz 44785d3498
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-11 18:57:47 -03:00
Nuckyz 473109b1d9
idk anymore 2024-08-05 13:25:25 -03:00
Nuckyz f398a1c871
fix breaking settings 😭 2024-08-03 21:56:33 -03:00
Nuckyz 9871e16e28
fix error spam in non app discord websites 2024-08-03 17:11:03 -03:00
Nuckyz b22d4622ed
for real now 2024-08-03 16:32:28 -03:00
Nuckyz f05d462a73
last one 2024-08-03 16:23:42 -03:00
Nuckyz c183018fb1
fix logged in dependant find 2024-08-03 15:28:18 -03:00
Nuckyz f9c11a1149
unexplode console shortcuts 2024-08-03 15:13:27 -03:00
Nuckyz 45a876a0d5
more fixes 2024-08-03 15:02:19 -03:00
Nuckyz 4d88a13f5e
clean 2024-08-03 14:54:12 -03:00
Nuckyz eeb4d26812
forgot this 2024-08-03 14:48:05 -03:00
Nuckyz 2429c283aa
this should be webpackDependantLazy 2024-08-03 14:43:21 -03:00
Nuckyz 1f1e3e8456
rename find 2024-08-03 14:42:05 -03:00
Nuckyz 64e1f294e6
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-03 14:34:31 -03:00
Nuckyz e801c71fdf
Add back top level destructuring for backwards compabitlity 2024-08-03 14:33:03 -03:00
Nuckyz 4677ac779a
Add findComponentByFields and filters.componentByFilter 2024-08-03 14:01:52 -03:00
Nuckyz ed32b7964d
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-03 13:29:02 -03:00
Nuckyz 76f8b0e38e
Make getUserSetting not return undefined 2024-08-03 13:27:46 -03:00
Nuckyz e24bdc2b6f
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-02 21:32:11 -03:00
Nuckyz 4bcefb744d
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-02 21:19:25 -03:00
Nuckyz 4d03a695aa
Fix broken patches 2024-08-02 21:17:47 -03:00
Nuckyz ca3768ca5d
🧹🧹🧹🧹🧹🧹 2024-08-02 20:48:44 -03:00
Nuckyz 6bdd0ba4a9
L overload react 2024-08-02 19:53:37 -03:00
Nuckyz 633a84581d
fix lint 2024-08-02 19:48:49 -03:00
Nuckyz 4a590d3d0a
Merge branch 'dev' into immediate-finds-modules-proxy 2024-08-02 19:46:57 -03:00
Nuckyz 1905aa0ae8
e 2024-07-25 21:37:37 -03:00
Nuckyz 026e716710
aaaaa 2024-07-24 18:03:21 -03:00
Nuckyz 9e6f24cc92
work 2024-07-24 18:02:02 -03:00
Nuckyz 75a8098590
I love not having a linter 2024-07-24 17:59:53 -03:00
Nuckyz 1f20074d4e
🧹🧹🧹 2024-07-24 17:55:35 -03:00
Nuckyz fb394c6e1a
it didnt 2024-07-24 15:20:12 -03:00
Nuckyz 465dd15e2c
boop (please work I cant test) 2024-07-24 15:18:24 -03:00
Nuckyz f676613173
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-20 19:37:54 -03:00
Nuckyz be6209ee44
why is this still here 2024-07-20 19:37:45 -03:00
Nuckyz 15a3694533
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-20 19:33:45 -03:00
Nuckyz 9fd16825e2
oops 2024-07-20 19:32:41 -03:00
Nuckyz 129b770ffa
fixes 2024-07-20 19:30:24 -03:00
Nuckyz 42353373db
mapMangledModule: Properly support component finds 2024-07-20 19:17:05 -03:00
Nuckyz 5f7c44f478
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-19 01:01:48 -03:00
Nuckyz 2df13a2e17
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-19 01:01:32 -03:00
Nuckyz dc116fc3b1
Merge branch 'dev' into modules-proxy-patches 2024-07-19 01:00:37 -03:00
Nuckyz cd3534f6fc
Merge branch 'dev' into immediate-finds 2024-07-19 00:59:35 -03:00
Nuckyz 01bd41413d
FriendsSince: Fix broken patch 2024-07-19 00:57:03 -03:00
Nuckyz 654a271eae
eeee 2024-07-19 00:46:48 -03:00
Nuckyz efd48e0364
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-17 17:03:53 -03:00
Nuckyz 09447d562e
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-17 17:03:48 -03:00
Nuckyz e57c99399d
Merge branch 'dev' into modules-proxy-patches 2024-07-17 17:03:12 -03:00
Nuckyz a3612dd4ee
Merge branch 'dev' into immediate-finds 2024-07-17 17:02:56 -03:00
Nuckyz e9328cadea
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-17 16:08:06 -03:00
Nuckyz 8fa19656ae
fix grammar 2024-07-17 16:07:50 -03:00
Nuckyz d58d8aea71
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-17 15:59:51 -03:00
Nuckyz 5462bb1438
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-17 15:59:48 -03:00
Nuckyz 9dadde6884
Merge branch 'dev' into modules-proxy-patches 2024-07-17 15:59:31 -03:00
Nuckyz 81a1822e70
Merge branch 'dev' into immediate-finds 2024-07-17 15:58:34 -03:00
Nuckyz 974953ba01
Fix mapMangledModule for primitives 2024-07-17 15:58:10 -03:00
Nuckyz 27fd143318
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-15 00:44:48 -03:00
Nuckyz 3bc71c688a
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-15 00:44:44 -03:00
Nuckyz d869b2ddbb
Merge branch 'dev' into modules-proxy-patches 2024-07-15 00:44:21 -03:00
Nuckyz fb3ae98419
Merge branch 'dev' into immediate-finds 2024-07-15 00:44:12 -03:00
Nuckyz 70df451e64
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-15 00:42:20 -03:00
Nuckyz 2fb616ebf1
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-15 00:42:16 -03:00
Nuckyz bd25e0cd75
Merge branch 'dev' into modules-proxy-patches 2024-07-15 00:42:07 -03:00
Nuckyz 62d4add6c1
Merge branch 'dev' into immediate-finds 2024-07-15 00:41:44 -03:00
Nuckyz 3f5491d379
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-14 00:29:48 -03:00
Nuckyz e35d0f680f
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-14 00:29:45 -03:00
Nuckyz 187ece1905
Merge branch 'dev' into modules-proxy-patches 2024-07-14 00:29:29 -03:00
Nuckyz 2b99f4ece3
Merge branch 'dev' into immediate-finds 2024-07-14 00:29:05 -03:00
Nuckyz 8bf98be472
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-12 16:43:20 -03:00
Nuckyz 0506505449
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-12 16:43:18 -03:00
Nuckyz 3edc36d5e0
Merge branch 'dev' into modules-proxy-patches 2024-07-12 16:43:06 -03:00
Nuckyz 6ffa969955
Merge branch 'dev' into immediate-finds 2024-07-12 16:42:46 -03:00
Nuckyz 6213fca9ed
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-11 17:36:22 -03:00
Nuckyz 56477d4e96
Fix testing factory filters on non factories 2024-07-11 17:32:36 -03:00
Nuckyz 104f193a76
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-11 17:17:37 -03:00
Nuckyz 293b90a6d2
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-11 17:17:34 -03:00
Nuckyz 8159937827
Merge branch 'dev' into modules-proxy-patches 2024-07-11 17:17:12 -03:00
Nuckyz aa35602827
Merge branch 'dev' into immediate-finds 2024-07-11 17:16:15 -03:00
Nuckyz 42c4845261
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-10 04:36:22 -03:00
Nuckyz 710f627016
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-10 04:36:19 -03:00
Nuckyz 4389b78410
Merge branch 'dev' into modules-proxy-patches 2024-07-10 04:36:05 -03:00
Nuckyz fde823fabf
Merge branch 'dev' into immediate-finds 2024-07-10 04:35:57 -03:00
Nuckyz cce8f14d72
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-07 15:15:58 -03:00
Nuckyz c8356570a3
crazy 2024-07-07 15:15:45 -03:00
Nuckyz 021baa54d3
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-07 15:11:00 -03:00
Nuckyz ddd5d9e0c3
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-07 15:10:52 -03:00
Nuckyz 920fb20d8e
Merge branch 'dev' into modules-proxy-patches 2024-07-07 15:10:41 -03:00
Nuckyz 438b3e0598
Merge branch 'dev' into immediate-finds 2024-07-07 15:10:21 -03:00
Nuckyz 763b24aa92
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-05 04:06:04 -03:00
Nuckyz 65013f0149
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-05 04:06:01 -03:00
Nuckyz 24795ba9f8
Merge branch 'dev' into modules-proxy-patches 2024-07-05 04:05:52 -03:00
Nuckyz aa29e479b9
Merge branch 'dev' into immediate-finds 2024-07-05 04:05:42 -03:00
Nuckyz dd25044afd
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-05 04:05:02 -03:00
Nuckyz 8c1979481e
Add patch timings testing to reporter 2024-07-05 04:02:34 -03:00
Nuckyz 2a1684d902
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-03 04:50:32 -03:00
Nuckyz b377cad1e6
fix reporter trying to JSON.stringify regex 2024-07-03 04:50:08 -03:00
Nuckyz 4e09e347e2
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-03 03:55:33 -03:00
Nuckyz ea6fccb54e
fix setting parsed regex as filter logging props 2024-07-03 03:47:01 -03:00
Nuckyz c784bc5dbd
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-03 00:12:49 -03:00
Nuckyz edba931afe
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-03 00:12:45 -03:00
Nuckyz 208882e8ec
Merge branch 'dev' into modules-proxy-patches 2024-07-03 00:12:08 -03:00
Nuckyz e0cb7242d6
Merge branch 'dev' into immediate-finds 2024-07-03 00:11:29 -03:00
Nuckyz b3ab32180c
Merge branch 'dev' into immediate-finds 2024-07-03 00:07:01 -03:00
Nuckyz 2506ba1b2e
feat(plugins): ConsoleJanitor (#2659) 2024-07-03 00:06:12 -03:00
Nuckyz 0d0c63f596
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-02 21:53:20 -03:00
Nuckyz 8abb68c553
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-02 21:53:06 -03:00
Nuckyz f6147c6c13
Merge branch 'dev' into modules-proxy-patches 2024-07-02 21:52:50 -03:00
Nuckyz b5fdb43cbf
Merge branch 'dev' into immediate-finds 2024-07-02 21:51:41 -03:00
Nuckyz 30057985c4
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-02 20:21:41 -03:00
Nuckyz a95037d80a
cleanup 2024-07-02 20:21:26 -03:00
Nuckyz 99e21ad284
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-02 20:17:34 -03:00
Nuckyz d90bcdb063
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-02 20:17:16 -03:00
Nuckyz 771d51bcc3
Merge branch 'dev' into modules-proxy-patches 2024-07-02 20:12:21 -03:00
Nuckyz c7e49672f5
Merge branch 'dev' into immediate-finds 2024-07-02 20:07:16 -03:00
Nuckyz 3331ed2155
forgot this 2024-07-02 20:01:15 -03:00
Nuckyz bc34d72b57
Support regex in webpack finds 2024-07-02 20:00:05 -03:00
Vendicated b333deb731
improve settings ui (again) 2024-07-02 18:51:51 +02:00
Nuckyz 614cbc1146
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-07-02 00:05:13 -03:00
Nuckyz a985286c88
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-07-02 00:05:10 -03:00
Nuckyz 1297408171
Merge branch 'dev' into modules-proxy-patches 2024-07-02 00:05:03 -03:00
Nuckyz cc536bdbf4
Merge branch 'dev' into immediate-finds 2024-07-02 00:04:54 -03:00
Nuckyz ea859f59b0
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-29 19:18:06 -03:00
Nuckyz a04ccd0d11
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-29 19:18:02 -03:00
Nuckyz c1b4eb5b04
Merge branch 'dev' into modules-proxy-patches 2024-06-29 19:17:50 -03:00
Nuckyz 3f059e17be
Merge branch 'dev' into immediate-finds 2024-06-29 19:17:35 -03:00
Nuckyz 48442aee1d
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-29 04:45:09 -03:00
Nuckyz 9ca13d1250
boop 2024-06-29 04:45:00 -03:00
Nuckyz 2c3be4533e
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-29 02:24:53 -03:00
Nuckyz 7bf2152353
bleh 2024-06-29 02:24:45 -03:00
Nuckyz a6f4622837
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-29 02:24:36 -03:00
Nuckyz 2f55c7b126
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-29 02:23:50 -03:00
Nuckyz 14d1a2d1ea
Merge branch 'dev' into immediate-finds 2024-06-29 02:23:23 -03:00
Nuckyz 332f3e532b
Dont depend on modules being an object again 2024-06-29 02:21:44 -03:00
Nuckyz 28a7fbb309
Merge branch 'dev' into modules-proxy-patches 2024-06-29 01:33:59 -03:00
Nuckyz 4caf86b60e
Merge branch 'dev' into modules-proxy-patches 2024-06-29 01:28:17 -03:00
Nuckyz 5a85d6e78e
Harder conditions for Sentry patching 2024-06-29 01:26:03 -03:00
Nuckyz 20cfa932a4
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-28 19:03:18 -03:00
Nuckyz 9e998db456
typings 2024-06-28 19:03:09 -03:00
Nuckyz 3d4a7638a4
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-28 18:56:02 -03:00
Nuckyz ab8da19e23
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-28 18:55:58 -03:00
Nuckyz b8335108e4
Merge branch 'dev' into modules-proxy-patches 2024-06-28 18:55:44 -03:00
Nuckyz 403276d307
Merge branch 'dev' into immediate-finds 2024-06-28 18:55:36 -03:00
Nuckyz 748a456cfb
Delete patching properties after used 2024-06-28 18:54:37 -03:00
Nuckyz 0cd0c813f2
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-28 18:43:31 -03:00
Nuckyz f647ff0ee9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-28 18:43:27 -03:00
Nuckyz c2d708a621
Merge branch 'dev' into modules-proxy-patches 2024-06-28 18:43:03 -03:00
Nuckyz 35343bd790
Merge branch 'dev' into immediate-finds 2024-06-28 18:39:49 -03:00
Nuckyz cc5d4a7b3a
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-28 00:58:26 -03:00
Nuckyz ae655111de
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-28 00:58:19 -03:00
Nuckyz b768c61ef8
Merge branch 'dev' into immediate-finds 2024-06-28 00:57:55 -03:00
Nuckyz d95367b31d
Merge branch 'dev' into modules-proxy-patches 2024-06-28 00:57:36 -03:00
Nuckyz 1e4ad4db4c
Fix for latest webpack change 2024-06-28 00:42:36 -03:00
Nuckyz d8ba959d1e
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 22:21:08 -03:00
Nuckyz 0742cecd41
clean commons 2024-06-27 22:20:58 -03:00
Nuckyz ed4a797ad3
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 19:19:29 -03:00
Nuckyz 505246954b
why 2024-06-27 19:19:22 -03:00
Nuckyz eecc21db91
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 19:00:23 -03:00
Nuckyz 962eaa9df7
this was too hacky and causing issues already 2024-06-27 18:57:57 -03:00
Nuckyz 0190ada1a1
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 18:47:52 -03:00
Nuckyz b5a1b3a124
a little more 2024-06-27 18:47:29 -03:00
Nuckyz 1f3b8cdfd8
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-27 18:43:04 -03:00
Nuckyz 1f2c26cdba
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 18:42:57 -03:00
Nuckyz 3b6bef1cda
Merge branch 'dev' into modules-proxy-patches 2024-06-27 18:41:24 -03:00
Nuckyz 858b0e3dd7
oops 2024-06-27 18:40:58 -03:00
Nuckyz 718ebd56ac
Allow mapMangledModule to be destructured again 2024-06-27 18:39:57 -03:00
Nuckyz 1511260666
Merge branch 'dev' into immediate-finds 2024-06-27 17:50:41 -03:00
Nuckyz 4ff7c22505
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-27 06:42:40 -03:00
Nuckyz 057ccfde11
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-27 06:40:56 -03:00
Nuckyz edf4e75ae2
Merge branch 'dev' into modules-proxy-patches 2024-06-27 06:38:08 -03:00
Nuckyz 62d9d1310d
Merge branch 'dev' into immediate-finds 2024-06-27 06:37:17 -03:00
Nuckyz e592a50d7c
Fix broken patches 2024-06-27 06:35:01 -03:00
Nuckyz c785053b86
Deprecate proxyLazy and proxyInner top level destructure 2024-06-27 06:01:13 -03:00
Nuckyz e9081d2a52
No longer destructure at top level 2024-06-27 05:45:06 -03:00
Nuckyz 98c67e1165
add findByPropsAndExtract; allow other finds to parse result 2024-06-27 05:29:07 -03:00
Nuckyz 6c7d4259e1
Merge branch 'dev' into immediate-finds 2024-06-27 05:04:55 -03:00
Nuckyz d8e3381fb3
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-23 19:48:34 -03:00
Nuckyz bdb9c75c74
e 2024-06-23 19:48:15 -03:00
Nuckyz a67b7847b1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-23 16:48:26 -03:00
Nuckyz bab081d4a9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-23 16:48:23 -03:00
Nuckyz 0e5099416c
Merge branch 'dev' into modules-proxy-patches 2024-06-23 16:48:17 -03:00
Nuckyz 20efa661b0
Merge branch 'dev' into immediate-finds 2024-06-23 16:48:09 -03:00
Nuckyz 94ba593be9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-23 16:29:03 -03:00
Nuckyz c9295d3a85
of course... 2024-06-23 16:28:39 -03:00
Nuckyz d55770797a
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-22 06:16:36 -03:00
Nuckyz b4b67a98da
fix proxies not being constructable 2024-06-22 06:14:43 -03:00
Nuckyz 453c0b62f4
ff 2024-06-22 05:50:09 -03:00
Nuckyz a3fa74735f
e 2024-06-22 05:40:34 -03:00
Nuckyz a3cab94a68
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-22 02:57:46 -03:00
Nuckyz c4e7233604
check for bundlePath value again 2024-06-22 02:57:36 -03:00
Nuckyz 889eb311f9
remove stuff I forgot 2024-06-22 02:50:34 -03:00
Nuckyz 03120d5a98
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-22 02:49:08 -03:00
Nuckyz 9446efadd5
a little more 2024-06-22 02:44:44 -03:00
Nuckyz 9c21c23364
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-22 02:39:26 -03:00
Nuckyz ba6d3c7e60
organize 2024-06-22 02:37:40 -03:00
Nuckyz cb1fff8d86
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-21 22:58:11 -03:00
Nuckyz c400db41c3
Merge branch 'dev' into modules-proxy-patches 2024-06-21 22:58:02 -03:00
Nuckyz de4743828a
Merge branch 'dev' into immediate-finds 2024-06-21 22:57:49 -03:00
Nuckyz 700a442ee4
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 22:55:20 -03:00
Nuckyz dd3904badd
fix issues related to nested proxyInner 2024-06-21 22:54:18 -03:00
Nuckyz 0d360fb7e7
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 19:52:16 -03:00
Nuckyz 2429231965
Merge branch 'dev' into modules-proxy-patches 2024-06-21 19:51:36 -03:00
Nuckyz 570137040c
actually fix oops 2024-06-21 19:51:11 -03:00
Nuckyz ad3bb91bc1
Merge branch 'dev' into immediate-finds 2024-06-21 19:50:09 -03:00
Nuckyz 161be30b2b
Fix dateFormat filter 2024-06-21 19:50:05 -03:00
Nuckyz 0a4bcd5ccd
fix cache find 2024-06-21 19:47:44 -03:00
Nuckyz 3a5859b815
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-21 18:57:31 -03:00
Nuckyz 1ea5f56549
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 18:57:28 -03:00
Nuckyz a7b02f2f1f
Merge branch 'dev' into modules-proxy-patches 2024-06-21 18:57:16 -03:00
Nuckyz 32306cc6c3
Merge branch 'dev' into immediate-finds 2024-06-21 18:56:24 -03:00
Nuckyz 8cfb289dc7
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 18:32:58 -03:00
Nuckyz 220062acdb
fix broken find 2024-06-21 18:32:49 -03:00
Nuckyz e5d5bc2d34
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 18:22:19 -03:00
Nuckyz 17cc81f15d
add findByFactoryCode to console shortcuts 2024-06-21 18:21:42 -03:00
Nuckyz eba42489e9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 18:14:54 -03:00
Nuckyz 51dee70ced
update error message 2024-06-21 18:14:41 -03:00
Nuckyz 11561e50f9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 18:06:08 -03:00
Nuckyz 2095cc8d03
update flux events 2024-06-21 18:06:02 -03:00
Nuckyz 6e61ef297c
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 17:58:45 -03:00
Nuckyz 58e810dfbe
Merge branch 'dev' into immediate-finds 2024-06-21 17:57:45 -03:00
Nuckyz b2497373f0
what is this doing here 2024-06-21 05:06:56 -03:00
Nuckyz 18841f4551
and also this 2024-06-21 05:06:11 -03:00
Nuckyz da6ceb8479
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 05:05:56 -03:00
Nuckyz 6b811dce55
forgot to export this 2024-06-21 05:05:44 -03:00
Nuckyz 8982a53b47
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-21 05:01:44 -03:00
Nuckyz 3cf702a2ba
fixes 2024-06-21 05:01:35 -03:00
Nuckyz cd79150a84
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-21 04:58:43 -03:00
Nuckyz 343e2802c3
boop 2024-06-21 04:52:08 -03:00
Nuckyz dc8b579488
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-21 04:51:45 -03:00
Nuckyz 066001c57a
Add wreq.j 2024-06-21 04:45:16 -03:00
Nuckyz 24a0f62801
Merge branch 'dev' into modules-proxy-patches 2024-06-21 04:38:27 -03:00
Nuckyz ef512e6ea1
forgot this 2024-06-21 04:30:12 -03:00
Nuckyz c6b2eeb86d
Merge branch 'dev' into immediate-finds 2024-06-21 04:24:13 -03:00
Nuckyz e457e58b49
Merge branch 'dev' into immediate-finds 2024-06-21 04:00:35 -03:00
Nuckyz cac0398276
ReverseImageSearch: Fix duplicate find 2024-06-21 03:59:38 -03:00
Nuckyz e93562b95b
Test mapMangledModule with new api 2024-06-21 03:53:39 -03:00
Nuckyz f6dbcb7709
lazy extractAndLoadChunks result 2024-06-21 03:05:30 -03:00
Nuckyz a82a0636cf
Merge branch 'dev' into immediate-finds 2024-06-21 03:03:07 -03:00
Nuckyz 2fc814124f
add new webpack apis 2024-06-21 02:23:04 -03:00
Vendicated a43d5d595a
Plugin Page: add indicator for excluded plugins 2024-06-20 19:56:14 +02:00
Nuckyz ceaaf9ab8a
Reporter: Test mapMangledModule 2024-06-20 01:00:07 -03:00
Nuckyz a01ee40591
Clean-up related additions to mangled exports 2024-06-19 23:50:04 -03:00
Nuckyz 26c2674652
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-18 17:20:00 -03:00
Nuckyz 9595f75a9a
Merge branch 'dev' into modules-proxy-patches 2024-06-18 17:19:52 -03:00
Nuckyz 2189ce407b
Merge branch 'dev' into immediate-finds 2024-06-18 17:19:42 -03:00
Nuckyz 7b4f97fa08
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-16 20:07:59 -03:00
Nuckyz f208472841
\n 2024-06-16 20:07:48 -03:00
Nuckyz 4e4a9f806f
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-16 19:57:31 -03:00
Nuckyz afe6d9f7b3
Separate wrapFactory and patchFactory 2024-06-16 19:53:31 -03:00
Nuckyz 2dac66d7c6
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-14 18:15:32 -03:00
Nuckyz 83b09a8073
Merge branch 'dev' into modules-proxy-patches 2024-06-14 18:15:23 -03:00
Nuckyz 13d47d91bf
Merge branch 'dev' into immediate-finds 2024-06-14 18:15:14 -03:00
Nuckyz 004f764c2b
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-13 23:31:30 -03:00
Nuckyz a815122e3c
Merge branch 'dev' into modules-proxy-patches 2024-06-13 23:31:20 -03:00
Nuckyz b88e7faa72
Merge branch 'dev' into immediate-finds 2024-06-13 23:31:10 -03:00
Nuckyz bb22355a57
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-13 00:03:39 -03:00
Nuckyz 591f433135
forgot the comment 2024-06-13 00:00:15 -03:00
Nuckyz f726376ab8
avoid circular dependency 2024-06-12 23:59:42 -03:00
Nuckyz 74bd89b721
Make all plugins use new settings API 2024-06-12 23:56:02 -03:00
Nuckyz aa4c6e5496
Update permissions 2024-06-12 22:50:25 -03:00
Nuckyz e8d696c18c
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-12 22:32:52 -03:00
Nuckyz d473d52047
update comment 2024-06-12 22:32:42 -03:00
Nuckyz 36c8058920
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-12 22:20:52 -03:00
Nuckyz 8d31f3cf62
Use $$vencordOriginal as fallback 2024-06-12 22:14:52 -03:00
Nuckyz 5021d2e344
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-12 19:16:04 -03:00
Nuckyz 92653eaf96
Merge branch 'dev' into modules-proxy-patches 2024-06-12 19:15:47 -03:00
Nuckyz 2f6e39c0bd
Merge branch 'dev' into immediate-finds 2024-06-12 19:15:40 -03:00
Nuckyz 5e52ecf42e
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-12 18:31:38 -03:00
Nuckyz b2ae33344b
Merge branch 'dev' into modules-proxy-patches 2024-06-12 18:31:23 -03:00
Nuckyz b24e8cb9e6
Merge branch 'dev' into immediate-finds 2024-06-12 18:31:14 -03:00
Nuckyz 73b1c7b811
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-12 17:50:28 -03:00
Nuckyz 210fada19a
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-12 17:49:52 -03:00
Nuckyz 002a1cfc16
grrr 2024-06-12 17:46:37 -03:00
Nuckyz e9e25306eb
grrr 2024-06-12 17:45:54 -03:00
Nuckyz 5931a72de2
More re-ordering 2024-06-12 17:37:16 -03:00
Nuckyz 3d0ce5449d
move down 2024-06-12 17:37:15 -03:00
Nuckyz 31c39bc761
guh 2024-06-12 17:37:15 -03:00
Nuckyz 1d2b8a43c0
Decouple factoryListeners from patchFactory 2024-06-12 17:37:15 -03:00
Nuckyz 6d587e6530
More re-ordering 2024-06-12 17:36:43 -03:00
Nuckyz 853585c0bc
move down 2024-06-12 17:33:26 -03:00
Nuckyz 6826fe003c
guh 2024-06-12 17:31:05 -03:00
Nuckyz c3bbc92fa2
Decouple factoryListeners from patchFactory 2024-06-12 17:30:26 -03:00
Nuckyz ed35c496dc
Merge branch 'dev' into modules-proxy-patches 2024-06-12 17:13:21 -03:00
Nuckyz dc8ac98a6e
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-12 17:11:04 -03:00
Nuckyz 337850c33a
Merge branch 'dev' into immediate-finds 2024-06-12 17:09:10 -03:00
Nuckyz 08f1b6a3c9
LazyComponents: Allow accessing inner; Improve typings 2024-06-12 17:06:20 -03:00
Nuckyz c8ad68c80b
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-10 20:29:26 -03:00
Nuckyz 7b056364da
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-10 20:29:03 -03:00
Nuckyz 7f3cad2528
Merge branch 'dev' into modules-proxy-patches 2024-06-10 20:28:45 -03:00
Nuckyz 5d290ecd35
Merge branch 'dev' into immediate-finds 2024-06-10 20:28:31 -03:00
Nuckyz b702b31744
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-07 23:29:21 -03:00
Nuckyz 3dbe621059
blehh 2024-06-07 23:29:13 -03:00
Nuckyz 55195676b8
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-07 23:25:28 -03:00
Nuckyz 76cb49c381
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-07 23:25:24 -03:00
Nuckyz 95c4cc09af
Merge branch 'dev' into modules-proxy-patches 2024-06-07 23:25:17 -03:00
Nuckyz a5b30e762a
Merge branch 'dev' into immediate-finds 2024-06-07 23:24:57 -03:00
Nuckyz 5bbf467be0
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-06 00:50:57 -03:00
Nuckyz 46c771f351
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-06 00:50:44 -03:00
Nuckyz 94ea4f8e5c
Merge branch 'dev' into modules-proxy-patches 2024-06-06 00:50:09 -03:00
Nuckyz fc8a0e4904
Merge branch 'dev' into immediate-finds 2024-06-06 00:49:36 -03:00
Nuckyz 9eb77cb7fd
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-05 23:58:09 -03:00
Nuckyz e1bbd67a9a
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-05 23:57:59 -03:00
Nuckyz 625b248a95
Merge branch 'dev' into modules-proxy-patches 2024-06-05 23:57:32 -03:00
Nuckyz 94c365b1c3
Merge branch 'dev' into immediate-finds 2024-06-05 23:57:26 -03:00
Nuckyz f70e9290ce
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-05 22:36:40 -03:00
Nuckyz 57b011aea7
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-05 22:36:36 -03:00
Nuckyz c8097f0f1a
Merge branch 'dev' into modules-proxy-patches 2024-06-05 22:36:29 -03:00
Nuckyz 5999af76c6
Merge branch 'dev' into immediate-finds 2024-06-05 22:34:55 -03:00
Nuckyz 05717d6bc3
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-02 18:49:21 -03:00
Nuckyz 53dd86fa6e
Improve typings and other stuff 2024-06-02 18:46:03 -03:00
Nuckyz 363f2e84fb
Merge branch 'dev' into immediate-finds-modules-proxy 2024-06-01 23:42:20 -03:00
Nuckyz 066ce07512
Merge branch 'dev' into modules-proxy-patches 2024-06-01 23:41:58 -03:00
Nuckyz f5b1b65db8
Merge branch 'dev' into immediate-finds 2024-06-01 23:41:49 -03:00
Nuckyz 6e6ee4db68
NoPendingCount: Fix for message requests 2024-06-01 23:40:05 -03:00
Nuckyz ac1c417e1c
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 19:53:07 -03:00
Nuckyz 4e14232b5a
Fix patching pre-populated factories 2024-06-01 19:52:17 -03:00
Nuckyz eddfca06ab
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 19:38:36 -03:00
Nuckyz 61e1eada01
Fix not restoring some original factories 2024-06-01 19:38:01 -03:00
Nuckyz 85322f9e90
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 18:42:44 -03:00
Nuckyz d329d74fec
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-01 18:42:40 -03:00
Nuckyz ac6a21374f
Merge branch 'dev' into modules-proxy-patches 2024-06-01 18:42:18 -03:00
Nuckyz b385be51d6
Merge branch 'dev' into immediate-finds 2024-06-01 18:40:33 -03:00
Nuckyz d8524b087c
Add shortcut for lazy loading chunks 2024-06-01 18:39:01 -03:00
Nuckyz c491122937
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 18:18:24 -03:00
Nuckyz 13337950dc
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-01 18:16:40 -03:00
Nuckyz 281ab9194b
Merge branch 'dev' into modules-proxy-patches 2024-06-01 18:13:49 -03:00
Nuckyz a1881bff3d
Merge branch 'dev' into immediate-finds 2024-06-01 18:12:22 -03:00
Nuckyz c50208b019
Add shortcut for lazy loading chunks 2024-06-01 18:10:45 -03:00
Nuckyz a8974f01eb
Merge branch 'dev' into immediate-finds 2024-06-01 18:09:19 -03:00
Nuckyz b79a0dadcb
Merge branch 'dev' into modules-proxy-patches 2024-06-01 18:06:38 -03:00
Nuckyz c4c92ed366
Add shortcut for lazy loading chunks 2024-06-01 17:51:50 -03:00
Vendicated 78fd37a4c6
fix(css): brand-experiment is now brand-500 2024-06-01 19:13:27 +02:00
Nuckyz 9de6e67cf1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 05:03:56 -03:00
Nuckyz 33d5753ca7
fix grammar issues 2024-06-01 05:03:47 -03:00
Nuckyz 8d3feef9a1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 01:45:03 -03:00
Nuckyz 8580332c82
cleanup 2024-06-01 01:44:18 -03:00
Nuckyz 4d8c56689c
Future proof against array modules 2024-06-01 01:40:44 -03:00
Nuckyz 5cbb816c1c
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:36:36 -03:00
Nuckyz b6594051d9
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-01 00:36:33 -03:00
Nuckyz 50415a949d
Merge branch 'dev' into modules-proxy-patches 2024-06-01 00:35:34 -03:00
Nuckyz 4b03454bce
Merge branch 'dev' into immediate-finds 2024-06-01 00:35:24 -03:00
Nuckyz f1b649e996
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:22:38 -03:00
Nuckyz db5397f41a
sdfdsf 2024-06-01 00:22:17 -03:00
Nuckyz c34f40e30d
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:17:26 -03:00
Nuckyz dd4d80872e
fix reporter part 2 2024-06-01 00:17:15 -03:00
Nuckyz eb381767cd
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:11:16 -03:00
Nuckyz 0aff3c29bc
Fix reporter 2024-06-01 00:11:00 -03:00
Nuckyz e7fdb3881a
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:06:39 -03:00
Nuckyz 5977ff8f6b
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-06-01 00:06:34 -03:00
Nuckyz dd13b96728
Revert "cya webpackChunkdiscord_app part 2"
This reverts commit a1e72e78d7.
2024-06-01 00:05:36 -03:00
Nuckyz 01fdeb7292
cya webpackChunkdiscord_app part 2 2024-06-01 00:05:15 -03:00
Nuckyz 6a3831c437
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-06-01 00:01:07 -03:00
Nuckyz c485864ee8
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-31 23:58:20 -03:00
Nuckyz 2ab7d3209e
Merge branch 'dev' into modules-proxy-patches 2024-05-31 23:57:07 -03:00
Nuckyz 654b2e8398
Merge branch 'dev' into immediate-finds 2024-05-31 23:47:31 -03:00
Nuckyz 3f573c9af3
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 19:58:36 -03:00
Nuckyz cbd9a9312c
don't depend in the value of bundlePath 2024-05-31 19:58:26 -03:00
Nuckyz 2656b60347
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 17:36:03 -03:00
Nuckyz fbb7ee50dd
Revert indexOf change 2024-05-31 17:34:32 -03:00
Nuckyz 4187932aa7
\n 2024-05-31 06:27:02 -03:00
Nuckyz a19fb71c70
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 06:20:17 -03:00
Nuckyz e21a6be4b6
sfdsfdsfdsf 2024-05-31 06:19:57 -03:00
Nuckyz b53c78c2ba
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 06:16:12 -03:00
Nuckyz db63fffe18
I should still be defining this 2024-05-31 06:16:01 -03:00
Nuckyz 41ab8da5ad
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-31 05:55:51 -03:00
Nuckyz f68effc7e2
more robust find 2024-05-31 05:50:34 -03:00
Nuckyz f21bfb9d78
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 05:30:36 -03:00
Nuckyz f4cc95da5a
Use indexOf in more places 2024-05-31 05:29:01 -03:00
Nuckyz 3a32490937
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 05:20:21 -03:00
Nuckyz 545d69aa6d
Use indexOf instead of includes; reset global find regex state 2024-05-31 05:19:34 -03:00
Nuckyz aa5ca42676
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-31 00:21:32 -03:00
Nuckyz 5197170b3d
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-31 00:21:29 -03:00
Nuckyz 47eec049fc
Not needed anymore and breaks interpolated strings with newlines 2024-05-31 00:21:15 -03:00
Nuckyz 022a0497c3
Merge branch 'dev' into modules-proxy-patches 2024-05-31 00:20:22 -03:00
Nuckyz e2f936538e
Merge branch 'dev' into immediate-finds 2024-05-31 00:20:06 -03:00
Nuckyz b323fbb486
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-30 18:39:39 -03:00
Nuckyz 0c4e265530
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-30 18:39:32 -03:00
Nuckyz 111a4f2aa8
Merge branch 'dev' into modules-proxy-patches 2024-05-30 18:39:14 -03:00
Nuckyz 46710bf8cb
Merge branch 'dev' into immediate-finds 2024-05-30 18:38:41 -03:00
Nuckyz 1f938211a8
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-30 18:12:07 -03:00
Nuckyz 8d362fc394
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-30 18:11:51 -03:00
Nuckyz 79849fd37d
Merge branch 'dev' into modules-proxy-patches 2024-05-30 18:11:23 -03:00
Nuckyz a838d587ae
Merge branch 'dev' into immediate-finds 2024-05-30 18:11:10 -03:00
Nuckyz 3a25da5f14
Fix wrong external files and clean up build script; Remove non used stuff 2024-05-30 18:03:00 -03:00
Nuckyz a1e72e78d7
cya webpackChunkdiscord_app part 2 2024-05-30 17:32:54 -03:00
Nuckyz 48fb6ecd1a
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-30 13:38:39 -03:00
Nuckyz 3c62e393a3
edit another license header 2024-05-30 13:38:22 -03:00
Nuckyz 034ef554fb
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-30 05:24:05 -03:00
Nuckyz 2da9bf8f0e
fix typo 2024-05-30 05:23:53 -03:00
Nuckyz eb5fb0df29
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-30 05:16:41 -03:00
Nuckyz 479a4069b2
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-30 05:16:27 -03:00
Nuckyz e22575805b
Merge branch 'dev' into modules-proxy-patches 2024-05-30 05:15:44 -03:00
Nuckyz c0984db612
Merge branch 'dev' into immediate-finds 2024-05-30 05:13:13 -03:00
Nuckyz 9a9c1b0487
Reporter: Properly implement reporter build of Vencord; Test more plugins; Fix running in wrong pages 2024-05-30 04:44:13 -03:00
Nuckyz 072619e539
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-30 01:10:48 -03:00
Nuckyz 9084459933
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-30 01:10:26 -03:00
Nuckyz 36f9eda3a8
Merge branch 'dev' into modules-proxy-patches 2024-05-30 01:09:11 -03:00
Nuckyz 99160638df
sdfgdsfdsds 2024-05-30 01:04:44 -03:00
Nuckyz 2574d5311d
Merge branch 'dev' into immediate-finds 2024-05-30 01:03:24 -03:00
Nuckyz 7816727e26
Merge branch 'dev' into immediate-finds 2024-05-30 01:02:25 -03:00
Nuckyz 892de53603
Fix extractAndLoadChunks issue with 2 match groups; Improve testing of lazy extractAndLoadChunks 2024-05-30 00:51:23 -03:00
Nuckyz 8de1ca86a9
I only understood today the reason for the Object.assign 2024-05-29 23:42:14 -03:00
Nuckyz 01ba87cd76
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-29 06:48:48 -03:00
Nuckyz 83222631ab
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-29 06:48:36 -03:00
Nuckyz b74581908e
Merge branch 'dev' into modules-proxy-patches 2024-05-29 06:48:14 -03:00
Nuckyz 896b8970b6
Merge branch 'dev' into immediate-finds 2024-05-29 06:47:23 -03:00
Nuckyz c8602ef52b
Fix reporter breaking because of ConsoleShortcuts 2024-05-29 06:45:44 -03:00
Nuckyz ac1423f90c
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-29 06:07:02 -03:00
Nuckyz d0e4ec0ad5
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-29 06:06:40 -03:00
Nuckyz 7509f203cc
Merge branch 'dev' into modules-proxy-patches 2024-05-29 06:05:44 -03:00
Nuckyz 17b575070f
Merge branch 'dev' into immediate-finds 2024-05-29 06:05:20 -03:00
Nuckyz 4a872236e1
Fix reporter breaking because of ConsoleShortcuts 2024-05-29 06:03:31 -03:00
Nuckyz d5440349c9
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-29 05:12:14 -03:00
Nuckyz 0f9b5f2d09
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-29 05:11:52 -03:00
Nuckyz 4db6c4b88a
Merge branch 'dev' into modules-proxy-patches 2024-05-29 05:10:24 -03:00
Nuckyz 6e1094a5d1
Merge branch 'dev' into immediate-finds 2024-05-29 05:08:19 -03:00
Nuckyz 15df3485d1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 18:11:40 -03:00
Nuckyz ea86df7174
Merge branch 'dev' into modules-proxy-patches 2024-05-28 18:11:03 -03:00
Nuckyz 66c466c9f0
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 18:03:41 -03:00
Nuckyz 96d5e1b89b
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-28 18:03:35 -03:00
Nuckyz 4b4caa798a
onceReady -> onceDiscordLoaded 2024-05-28 18:02:57 -03:00
Nuckyz 73503945fb
Add WebpackInstances shortcut 2024-05-28 17:58:54 -03:00
Nuckyz 43b679d676
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-28 17:51:36 -03:00
Nuckyz 011b375d02
fix reporter 2024-05-28 17:49:20 -03:00
Nuckyz 9f1f2b15a4
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 17:46:58 -03:00
Nuckyz a1309ea897
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-28 17:45:36 -03:00
Nuckyz a4073703fd
explain UNCONFIGURABLE_PROPERTIES better 2024-05-28 17:44:36 -03:00
vee 84b9e3fec1
ConsoleShortcuts: Fix autocomplete on lazies, add more utils (#2519) 2024-05-28 17:44:36 -03:00
Nuckyz 6bbd91fafc
Merge branch 'dev' into immediate-finds 2024-05-28 17:41:34 -03:00
Nuckyz d78f1c8000
where did this come from? 2024-05-28 17:15:25 -03:00
Nuckyz 64262001e8
boop 2024-05-28 17:14:35 -03:00
Nuckyz 6b648f3d38
oops! 2024-05-28 17:12:36 -03:00
Nuckyz 1eeadbcd97
export all webpack instances 2024-05-28 17:11:17 -03:00
Nuckyz f016d277b7
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 04:27:52 -03:00
Nuckyz 9c2545ab16
undo explosion 2024-05-28 04:27:36 -03:00
Nuckyz b36d3b4385
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 04:00:41 -03:00
Nuckyz acbc932542
give name to PatchedFactory 2024-05-28 03:57:56 -03:00
Nuckyz 3590d5abff
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 03:35:52 -03:00
Nuckyz c9c09b95a3
fix typo 2024-05-28 03:35:38 -03:00
Nuckyz 9128eb5760
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 03:34:51 -03:00
Nuckyz 513d9f4209
I knew I was forgetting something 2024-05-28 03:34:40 -03:00
Nuckyz 06393211b1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-28 03:32:02 -03:00
Nuckyz ac3130d37e
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-28 03:31:54 -03:00
Nuckyz 3e2952890f
Merge branch 'dev' into modules-proxy-patches 2024-05-28 03:31:37 -03:00
Nuckyz a0751a0f84
Merge branch 'dev' into immediate-finds 2024-05-28 03:27:17 -03:00
Nuckyz fa45beb8ca
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-27 23:33:43 -03:00
Nuckyz 539b70cd52
lmao oops 2024-05-27 23:32:40 -03:00
Nuckyz e96458fafa
fixes for if we use prototype proxy in the future 2024-05-27 23:31:08 -03:00
Nuckyz a1542bcec5
okay codium agent 2024-05-27 23:21:51 -03:00
Nuckyz e00da485e8
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-27 18:28:22 -03:00
Nuckyz 513eea8d14
Prepare for in case modules object is accessed directly in the future 2024-05-27 18:27:21 -03:00
Nuckyz 490e9131b5
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 21:17:18 -03:00
Nuckyz 9ceb0ae7cb
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-26 21:17:15 -03:00
Nuckyz 6d59a943da
Merge branch 'dev' into modules-proxy-patches 2024-05-26 21:17:02 -03:00
Nuckyz 00d71fbeab
Merge branch 'dev' into immediate-finds 2024-05-26 21:16:46 -03:00
Nuckyz 4459d11a97
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 20:57:55 -03:00
Nuckyz 1eab0146dd
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-26 20:57:07 -03:00
Nuckyz f345484e5b
Merge branch 'dev' into modules-proxy-patches 2024-05-26 20:56:31 -03:00
Nuckyz 65adaf335c
adjust size 2024-05-26 20:55:33 -03:00
Nuckyz 437e4eae44
Update flux events again 2024-05-26 20:53:08 -03:00
Nuckyz f7d12d209c
Merge branch 'dev' into immediate-finds 2024-05-26 20:47:52 -03:00
Nuckyz 8a5678bec5
update more licenses 2024-05-26 20:41:28 -03:00
Nuckyz 1f99162b5a
update patchWebpack license 2024-05-26 20:38:57 -03:00
Nuckyz 8c5f2c897e
Document patchWebpack better 2024-05-26 20:22:03 -03:00
Nuckyz 9ada9bc1a9
e part 2 2024-05-26 19:51:34 -03:00
Nuckyz 8fd22f6deb
e 2024-05-26 19:50:47 -03:00
Nuckyz c1e78b4397
hasOwn != in 2024-05-26 19:50:16 -03:00
Nuckyz 32a2c90761
fix typing of the global 2024-05-26 19:40:33 -03:00
Nuckyz dae3841f10
ughh 2024-05-26 19:38:25 -03:00
Nuckyz 4d27643d39
type more 2024-05-26 19:37:47 -03:00
Nuckyz c2047e5f3b
fix typos 2024-05-26 19:27:52 -03:00
Nuckyz 18142ecccb
fix doc 2024-05-26 19:26:26 -03:00
Nuckyz 440cb1f29c
Properly document wreq.a 2024-05-26 19:25:06 -03:00
Nuckyz 64b1ab1112
Properly document wreq.a 2024-05-26 19:24:59 -03:00
Nuckyz 3da88100df
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 07:00:21 -03:00
Nuckyz 3e3201ad0d
improve wreq docs 2024-05-26 07:00:03 -03:00
Nuckyz a2bda05211
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 05:47:45 -03:00
Nuckyz 1ed956114f
fix logic 2024-05-26 05:46:53 -03:00
Nuckyz 2e27a513ac
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 05:30:32 -03:00
Nuckyz a8fa685cfa
Add back running modules without patches 2024-05-26 05:29:05 -03:00
Nuckyz b2036762b5
Add back running modules without patches 2024-05-26 05:28:34 -03:00
Nuckyz 067a16c9dc
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 05:24:55 -03:00
Nuckyz 265cf12d39
I love 2024-05-26 05:24:03 -03:00
Nuckyz b580d6dcfb
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 05:20:39 -03:00
Nuckyz affd527bc1
Make factory wrapper a little more future proof 2024-05-26 05:19:52 -03:00
Nuckyz 7d928e53aa
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 01:14:13 -03:00
Nuckyz b10afebc98
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-26 01:14:01 -03:00
Nuckyz 1a8a901e0a
Merge branch 'dev' into modules-proxy-patches 2024-05-26 01:13:24 -03:00
Nuckyz d936604f35
Merge branch 'dev' into immediate-finds 2024-05-26 01:12:22 -03:00
Nuckyz 4dcc265be0
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-26 00:30:58 -03:00
Nuckyz 3e6e399544
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-26 00:29:49 -03:00
Nuckyz 9af63b362d
more future proof 2024-05-26 00:27:13 -03:00
Nuckyz 090a3bc0a8
this formatter is stupid 2024-05-25 23:58:42 -03:00
Nuckyz 3331723496
fix the linting 2024-05-25 23:57:23 -03:00
Nuckyz 999d6c812f
better types? no ts-ignore, also filters.componentByCode is recursive now 2024-05-25 23:51:59 -03:00
Nuckyz c9c1e0c6c5
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 18:46:52 -03:00
Nuckyz 1e55ae5327
this is more clean 2024-05-24 18:46:36 -03:00
Nuckyz 5b96881177
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 08:24:56 -03:00
Nuckyz daa1a35fc3
Factories are called with a this 2024-05-24 08:23:41 -03:00
Nuckyz ef895e787a
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 08:02:04 -03:00
Nuckyz 2f16cdf77b
Make toStringTag non enumerable 2024-05-24 07:59:56 -03:00
Nuckyz e990795783
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 07:41:52 -03:00
Nuckyz 8dde496757
one more name cuz why not 2024-05-24 07:40:36 -03:00
Nuckyz 35f950c6e3
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 05:24:59 -03:00
Nuckyz 5fbabb0b70
sob 2024-05-24 05:24:37 -03:00
Nuckyz ff9cc2e9e5
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 05:19:20 -03:00
Nuckyz 3793acd9bb
forgot the comment 2024-05-24 05:19:12 -03:00
Nuckyz ebae259f5d
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 05:17:17 -03:00
Nuckyz 3296ee1c4b
Remove onChunksLoaded patch 2024-05-24 05:14:27 -03:00
Nuckyz 2f87363b89
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 03:58:15 -03:00
Nuckyz bacf021a28
aaaaa 2024-05-24 03:57:54 -03:00
Nuckyz 1138e22f58
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 03:50:03 -03:00
Nuckyz d6b5bc58ce
how many times 2024-05-24 03:49:14 -03:00
Nuckyz bd2264c125
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 03:46:43 -03:00
Nuckyz 86f69e84c1
I'm stupid 2024-05-24 03:45:46 -03:00
Nuckyz 488f133a90
Handle if for some reason modules are set again 2024-05-24 03:44:40 -03:00
Nuckyz 77d8e70059
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 03:13:56 -03:00
Nuckyz f64b228cb9
better log 2024-05-24 03:13:41 -03:00
Nuckyz 90f37471e5
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 03:13:09 -03:00
Nuckyz b192c89146
I can never not forget something 2024-05-24 03:12:48 -03:00
Nuckyz ae10d3667c
Take a different approach which requires less cursed code 2024-05-24 03:12:48 -03:00
Nuckyz f727d101fc
I can never not forget something 2024-05-24 03:09:25 -03:00
Nuckyz 9bbec66ea5
Take a different approach which requires less cursed code 2024-05-24 03:08:35 -03:00
Nuckyz 0146789514
Preserve original modules prototype 2024-05-24 02:02:54 -03:00
Nuckyz b38ab066d9
Preserve original modules prototype 2024-05-24 02:02:28 -03:00
Nuckyz 37514e0720
mod -> module 2024-05-24 00:14:07 -03:00
Nuckyz aa9be97f83
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-24 00:00:36 -03:00
Nuckyz d8c6559967
I forgot this 2024-05-23 23:56:29 -03:00
Nuckyz 72b014fe67
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-23 23:55:09 -03:00
Nuckyz 8eb4eab2b0
oops you were not meant to be here 2024-05-23 23:33:20 -03:00
Nuckyz 07361ff6fe
eww new line 2024-05-23 23:32:46 -03:00
Nuckyz 64212512ca
cya dummyObj 2024-05-23 23:20:46 -03:00
Nuckyz 5e762ddd04
Add names to Modules objects 2024-05-23 23:18:43 -03:00
Nuckyz 74f36a093b
Preserve ProxyDummy function name after minification 2024-05-23 23:14:00 -03:00
Nuckyz c01a8c2f78
I changed my mind 2024-05-23 22:52:32 -03:00
Nuckyz 90c26432f5
Properly set receiver 2024-05-23 22:51:23 -03:00
Nuckyz 6f25005057
Monkey patch toString on proxyInner and proxyLazy 2024-05-23 22:20:24 -03:00
Nuckyz 23c8818ed2
Merge branch 'dev' into immediate-finds 2024-05-23 22:13:20 -03:00
Nuckyz 16d05c8935
Merge branch 'dev' into modules-proxy-patches 2024-05-23 21:58:54 -03:00
Nuckyz c5541d297d
Optimize slowest patches 2024-05-23 21:58:06 -03:00
Vendicated a120b35f4f
Bump to v1.8.6 2024-05-23 21:58:06 -03:00
Vendicated 9740d28530
discord why tf would u roll back to 10 days old build??? 2024-05-23 21:58:05 -03:00
Nuckyz 8e9434cdd5
Make reporter faster 2024-05-23 21:57:12 -03:00
Nuckyz f5be78d101
Patching toString -> String 2024-05-23 20:02:41 -03:00
Nuckyz bd95cc449f
Exit script if a chunk failed to load 2024-05-23 19:54:40 -03:00
Nuckyz bdd4b0f143
Make eagerPatches an internal setting 2024-05-23 19:53:19 -03:00
Nuckyz a60c8374ed
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-23 07:10:39 -03:00
Nuckyz 1013c34840
HORROR 2024-05-23 07:09:15 -03:00
Nuckyz 7b7b87316d
HORROR 2024-05-23 07:09:03 -03:00
Nuckyz 6567ff7435
any -> ModuleExports 2024-05-23 06:58:51 -03:00
Nuckyz 22a75c4589
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-23 06:51:07 -03:00
Nuckyz 67b5ecca51
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-23 06:42:53 -03:00
Nuckyz cdbd9ad101
Merge branch 'dev' into immediate-finds 2024-05-23 06:42:07 -03:00
Nuckyz 1e96638219
oops! 2024-05-23 06:38:22 -03:00
Nuckyz 7371abbaec
lmao 2024-05-23 06:29:07 -03:00
Nuckyz cfb493c593
make reporter use eagerPatches 2024-05-23 06:22:01 -03:00
Nuckyz ac61a0377f
clean up 2024-05-23 06:09:47 -03:00
Nuckyz bb3f629672
Merge branch 'dev' into modules-proxy-patches 2024-05-23 06:07:25 -03:00
Nuckyz 3ab68f9296
Option for eager patching 2024-05-23 06:07:13 -03:00
Nuckyz 01a4ac9c13
sometimes I'm stupid 2024-05-23 03:42:58 -03:00
Nuckyz 66e1db1fdb
more 2024-05-23 03:39:59 -03:00
Nuckyz 688449ed62
forgot this! 2024-05-23 03:38:06 -03:00
Nuckyz 5ca4e58fad
Clean up WebpackRequire typings 2024-05-23 03:36:53 -03:00
Nuckyz deb0f7b9c6
Merge remote-tracking branch 'upstream/dev' into modules-proxy-patches 2024-05-23 03:12:46 -03:00
Nuckyz 40a1f48267
boops 2024-05-23 03:10:59 -03:00
Nuckyz bc367b1d2a
and also a fix 2024-05-22 06:25:30 -03:00
Nuckyz f6a7cdc430
more fix 2024-05-22 06:22:37 -03:00
Nuckyz d5bcbf54f9
fix 2024-05-22 06:17:31 -03:00
Nuckyz 4b2734610f
Add WebpackRequire typings 2024-05-22 06:08:40 -03:00
Nuckyz c4645f79c6
Make patchedBy a string set 2024-05-22 06:08:28 -03:00
Nuckyz cf9bbfc78f
stop annoying me 2024-05-22 01:30:17 -03:00
Nuckyz 6cc40eb095
okay CodiumAI 2024-05-22 01:27:39 -03:00
Nuckyz 95acb147d1
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-22 01:11:45 -03:00
Nuckyz 21fea87551
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-22 01:11:26 -03:00
Nuckyz 2a2124c5a0
Merge branch 'dev' into modules-proxy-patches 2024-05-22 01:11:04 -03:00
Nuckyz 1a1e5c2e1d
Fix Flex component type 2024-05-22 01:07:58 -03:00
Nuckyz c9d9d53fb1
Merge branch 'dev' into immediate-finds 2024-05-22 01:01:58 -03:00
Nuckyz dc81d1c14c
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-19 23:22:58 -03:00
Nuckyz b938bdf138
Clarify about sentry webpack 2024-05-19 23:22:48 -03:00
Nuckyz e74aabb988
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-19 23:15:31 -03:00
Nuckyz ab24ce08e3
Merge branch 'dev' into modules-proxy-patches 2024-05-19 23:14:05 -03:00
Nuckyz c2435bb9dd
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-19 23:11:29 -03:00
Nuckyz d678e68899
Merge branch 'immediate-finds' into immediate-finds-modules-proxy 2024-05-19 23:10:56 -03:00
Nuckyz dbb6f4165b
Merge branch 'dev' into modules-proxy-patches 2024-05-19 23:10:11 -03:00
Nuckyz 9a1a7b374f
Merge branch 'dev' into immediate-finds 2024-05-19 23:09:43 -03:00
Nuckyz ec373069b3
Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy 2024-05-19 23:01:08 -03:00
Nuckyz 329bc68bf5
Merge branch 'dev' into immediate-finds 2024-05-19 22:58:19 -03:00
Nuckyz 2a77941dff
Proxy modules object for patching 2024-05-19 22:49:58 -03:00
Nuckyz d36c361b47
Merge branch 'dev' into immediate-finds 2024-05-19 04:23:51 -03:00
Nuckyz b17963169f
Merge branch 'dev' into immediate-finds 2024-05-19 03:56:33 -03:00
Nuckyz 118361723c
Merge branch 'dev' into immediate-finds 2024-05-18 21:55:23 -03:00
Nuckyz 97e2e2c1c8
Merge branch 'dev' into immediate-finds 2024-05-18 21:46:13 -03:00
Nuckyz dbee2d9ecc
Merge branch 'dev' into immediate-finds 2024-05-18 00:39:00 -03:00
Nuckyz 1283494b46
Merge branch 'dev' into immediate-finds 2024-05-17 23:05:04 -03:00
Nuckyz e72c732d58
FriendsSince: Show in user profile modal 2024-05-17 23:03:44 -03:00
Nuckyz d40dfc345f
Merge branch 'dev' into immediate-finds 2024-05-17 19:47:33 -03:00
vee 70f60193b0
explosion part 2 2024-05-17 23:10:21 +02:00
vee 9e60d4979d
explosion 2024-05-17 23:08:59 +02:00
vee 3562c8ae11
Merge branch 'dev' into immediate-finds 2024-05-17 23:08:07 +02:00
Nuckyz 093de43d54
Merge branch 'dev' into immediate-finds 2024-05-17 05:44:45 -03:00
Nuckyz 86ad3bd4fc
Merge branch 'dev' into immediate-finds 2024-05-17 05:22:05 -03:00
Nuckyz 8045d65e99
Merge branch 'dev' into immediate-finds 2024-05-17 05:09:35 -03:00
Nuckyz 63a1fe2c70
Merge branch 'dev' into immediate-finds 2024-05-16 02:39:41 -03:00
Nuckyz 55760bc42b
Merge branch 'dev' into immediate-finds 2024-05-16 01:10:41 -03:00
Nuckyz 983013446d
Merge branch 'dev' into immediate-finds 2024-05-16 00:23:30 -03:00
Nuckyz 569dace244
Merge branch 'dev' into immediate-finds 2024-05-15 23:40:23 -03:00
Nuckyz 8e5a2f6e59
Merge branch 'dev' into immediate-finds 2024-05-15 23:30:49 -03:00
Nuckyz 41a1732df2
MessageLatency: Fix wrong constant 2024-05-15 23:29:36 -03:00
Nuckyz 487af1c789
Merge branch 'dev' into immediate-finds 2024-05-15 23:25:48 -03:00
Nuckyz 5168f326a3
keep proper type 2024-05-15 23:07:35 -03:00
Nuckyz 4feaa40de7
Fix makeLazy not incrementing tries if factory errors 2024-05-15 23:06:21 -03:00
Nuckyz 7f5aaada88
Merge branch 'dev' into immediate-finds 2024-05-15 23:02:13 -03:00
Nuckyz 725103a77c
Merge branch 'dev' into immediate-finds 2024-05-15 00:39:02 -03:00
Nuckyz a878ea0b39
Merge branch 'dev' into immediate-finds 2024-05-15 00:04:10 -03:00
Nuckyz 0cc89996c6
forgot this 2024-05-15 00:00:54 -03:00
Nuckyz c72099fc39
feat: Allow finds to use regex (#2452) 2024-05-14 23:59:07 -03:00
Nuckyz 84c223d471
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-14 23:55:11 -03:00
Nuckyz 82f9e36e5a
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-14 23:53:41 -03:00
Nuckyz 7c8c2ff5b8
Merge branch 'dev' into immediate-finds 2024-05-14 22:54:51 -03:00
Ulysses Zhan dc73b89b29
new plugin CtrlEnterSend (#1794)
Co-authored-by: vee <vendicated@riseup.net>
2024-05-14 20:52:55 -03:00
Ulysses Zhan 2596bf0990
new plugin NoServerEmoji ~ hides server emojis from autocomplete (#1787)
Co-authored-by: vee <vendicated@riseup.net>
2024-05-14 20:52:55 -03:00
Board 7169dfe61a
ThemeAttributes: add larger avatar url variables to avatars (#2449)
Co-authored-by: vee <vendicated@riseup.net>
2024-05-14 20:52:54 -03:00
Vendicated 5ba5eca1a1
fix Vencord Settings section being added multiple times 2024-05-14 20:52:54 -03:00
Vendicated 4209bfd3aa
bump to v1.8.4 2024-05-14 20:52:54 -03:00
Vendicated c007fc7478
fix settings ui on canary 2024-05-14 20:52:54 -03:00
Nuckyz 903fa2cf11
Merge branch 'dev' into immediate-finds 2024-05-13 23:18:00 -03:00
Nuckyz 7d91dea822
Merge branch 'dev' into immediate-finds 2024-05-13 23:15:16 -03:00
Nuckyz 4fc4f1cb75
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-13 02:09:34 -03:00
Nuckyz 45d2cf49e0
Merge branch 'dev' into immediate-finds 2024-05-13 00:10:32 -03:00
Nuckyz b798f31669
Merge branch 'dev' into immediate-finds 2024-05-12 21:33:34 -03:00
Nuckyz 7e1524362c
Merge branch 'dev' into immediate-finds 2024-05-12 20:46:39 -03:00
Nuckyz e04dd85957
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-11 22:30:38 -03:00
Nuckyz 258e1efdce
Merge branch 'dev' into immediate-finds 2024-05-11 18:42:11 -03:00
Nuckyz f6e484034c
more pog 2024-05-11 06:05:20 -03:00
Nuckyz 5676f45781
whatever 2024-05-11 05:56:26 -03:00
Nuckyz e11d651e33
work 2024-05-11 05:51:18 -03:00
Nuckyz 09a6a9bf85
wtf? 2024-05-11 05:47:53 -03:00
Nuckyz 1b64419ef1
Make commons have proper ProxyInner typing 2024-05-11 05:44:52 -03:00
Nuckyz 5edff4a3c5
types 2024-05-11 05:19:12 -03:00
Nuckyz b043d8abb7
Clarify more what the find methods return 2024-05-11 01:11:57 -03:00
Nuckyz e15868d499
Merge branch 'dev' into immediate-finds 2024-05-09 03:17:08 -03:00
Nuckyz a892a507be
Merge branch 'dev' into immediate-finds 2024-05-09 03:01:44 -03:00
Nuckyz 33a5f30ae4
ShowMeYourName: Fix regression caused by adding ErrorBoundary 2024-05-09 02:59:08 -03:00
Nuckyz 38b6c7fa6c
Merge branch 'dev' into immediate-finds 2024-05-09 00:46:24 -03:00
Nuckyz bd88625d25
ErrorBoundary some more components 2024-05-09 00:44:04 -03:00
Nuckyz 5fca61f581
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-08 22:23:42 -03:00
Nuckyz cc6cef02c1
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-08 22:17:04 -03:00
Vendicated 546c5105b2
im the dumbest dumdum 2024-05-09 03:12:11 +02:00
Nuckyz f65749e2d4
Merge branch 'dev' into immediate-finds 2024-05-08 18:55:48 -03:00
Nuckyz fb8f00137c
I'm dumb 2024-05-08 18:51:47 -03:00
Nuckyz 20b071aa2d
Merge branch 'dev' into immediate-finds 2024-05-08 18:47:22 -03:00
Nuckyz b7c1b495af
CrashHandler: Increment timeout for trying to recover 2024-05-08 18:42:46 -03:00
Nuckyz 4d80c53dd0
Merge branch 'dev' into immediate-finds 2024-05-08 17:14:47 -03:00
Nuckyz 035e2add0b
Fix MoreUserTags freezing the client 2024-05-08 06:44:18 -03:00
Nuckyz f70cc5205c
Reporter Bad Webpack Finds logs cleanups 2024-05-08 06:16:00 -03:00
Nuckyz fa948e8639
Clean up all finds; Make common components NoopComponents by default
I went through every single find and made sure every component find is using the proper method
2024-05-08 04:48:48 -03:00
Nuckyz 4cc6789b5b
misc fixes 2024-05-08 00:25:34 -03:00
Nuckyz 4753efa33c
Merge branch 'dev' into immediate-finds 2024-05-08 00:19:49 -03:00
Nuckyz 283a4b23ba
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-07 22:29:33 -03:00
Nuckyz 3b7f1be9a2
i18nMessages: Keep language codes only 2024-05-07 22:23:44 -03:00
Nuckyz c2e12e2827
why not 2024-05-07 22:10:05 -03:00
Nuckyz 8b6620ca2f
Update FluxEvents and Permissions 2024-05-07 22:06:45 -03:00
Nuckyz f1e2d5572a
Update these license headers because I forgot in the other pr 2024-05-07 21:44:26 -03:00
Nuckyz 49fcfd74df
Merge branch 'dev' into immediate-finds 2024-05-07 21:40:02 -03:00
Nuckyz 511ec1b129
Add warn for using deprecated method 2024-05-07 21:33:05 -03:00
Nuckyz 94843a77ac
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-07 16:27:52 -03:00
Nuckyz 8873391496
Fix the lint :) 2024-05-07 06:33:07 -03:00
Nuckyz b77b654df1
I should have done this in the dev branch but it's whatever now 2024-05-07 06:30:24 -03:00
Nuckyz c65e1f88d2
Improve description of some finds 2024-05-07 06:28:43 -03:00
Nuckyz 9cd20e3cea
Merge branch 'dev' into immediate-finds 2024-05-07 06:23:36 -03:00
Nuckyz f04bd8a7ad
useStateFromStores: Document 3rd param and fix JSDoc 2024-05-07 06:13:38 -03:00
Nuckyz fa82939e62
Merge branch 'dev' into immediate-finds 2024-05-07 03:22:20 -03:00
Nuckyz a1fefcf27a
Cant modify this array because we only clone 1 level deep 2024-05-07 03:07:03 -03:00
Nuckyz 65b6440024
Clean up 2024-05-07 03:01:45 -03:00
Nuckyz 6e0064c5fc
give a name to the proxy dummy function, for better logs in the console 2024-05-07 02:57:17 -03:00
Nuckyz b047f9ce28
Merge branch 'dev' into immediate-finds 2024-05-07 02:49:24 -03:00
Nuckyz d97596a16a
e 2024-05-07 02:38:12 -03:00
Nuckyz 5b6d0f42fd
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-07 01:14:45 -03:00
Nuckyz 4a89fadedd
Make Webpack finds not need to re-search 2024-05-07 01:13:46 -03:00
Nuckyz 886071af4d
Clean up Webpack ComponentWrapper 2024-05-06 23:22:36 -03:00
Nuckyz 12c9c324a1
Merge branch 'dev' into immediate-finds 2024-05-06 05:08:46 -03:00
Nuckyz e311bd9f76
Merge branch 'dev' into immediate-finds 2024-05-05 17:56:21 -03:00
Nuckyz 707c23b188
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-05 05:15:35 -03:00
Sqaaakoi 49e78793c5
ImageLink: Fix embed showing in gifs (#2417) 2024-05-05 05:15:01 -03:00
Nuckyz 8d31330d3e
Fix wrongfully logging LazyComponent factory failed 2024-05-05 02:52:41 -03:00
Nuckyz 17397dbe08
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-05 02:49:58 -03:00
Fafa b98544ed1f
ReviewDB: Fix context menus being added to folders (#2416) 2024-05-05 01:42:15 -03:00
Nuckyz 043675f3f8
Forgot to change this 2024-05-04 23:56:02 -03:00
Nuckyz 3b1cb02663
Merge branch 'dev' into immediate-finds 2024-05-04 23:18:31 -03:00
Nuckyz bc68bc0312
ImplicitRelationships: Properly test find 2024-05-04 23:15:55 -03:00
Nuckyz b3819228ed
Resolve PluginSettings circular deps better 2024-05-04 23:15:55 -03:00
Nuckyz c23c65733b
Merge branch 'dev' into immediate-finds 2024-05-04 21:17:02 -03:00
Nuckyz cfefdbc7a7
Improve proxyLazy 2024-05-04 20:56:32 -03:00
Nuckyz 70103e8111
Add better explanation for destructuring primitives 2024-05-04 17:49:20 -03:00
Nuckyz 240705652c
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-03 20:46:10 -03:00
Nuckyz d42c9547ab
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-03 20:18:05 -03:00
Nuckyz ac85b3508b
Comment proxyInner better 2024-05-03 20:11:52 -03:00
Nuckyz 9ece4dddd3
Better deprecation comments 2024-05-03 19:39:21 -03:00
Nuckyz 36f5d9acc6
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-03 19:23:48 -03:00
Nuckyz d4956f3ec7
Merge branch 'dev' into immediate-finds 2024-05-03 19:09:49 -03:00
Nuckyz 8279c8d0ba
Merge branch 'dev' into immediate-finds 2024-05-03 18:47:56 -03:00
Nuckyz 74e3ba42e0
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-03 17:56:42 -03:00
Nuckyz 784ae0a02d
Merge remote-tracking branch 'upstream/dev' into immediate-finds 2024-05-03 17:35:20 -03:00
Nuckyz 901d803ba9
Make it less breaking: Add old methods back but mark as deprecated 2024-05-03 05:35:53 -03:00
Nuckyz bdb693302a
Copy Array -> Use for loop with len 2024-05-03 05:19:35 -03:00
Nuckyz f8a7d1d634
Merge branch 'dev' into immediate-finds 2024-05-03 04:55:19 -03:00
Nuckyz 770078f236
More things 2024-05-03 04:49:14 -03:00
Nuckyz f1dd39885b
Clean up commons 2024-05-03 01:50:50 -03:00
Nuckyz a29115ba78
Fix ReviewDB 2024-05-03 01:21:52 -03:00
Nuckyz cd5e0aeec1
throw a rock at ben shapiro 2024-05-02 23:42:42 -03:00
Nuckyz 75fa0ff708
Immediate finds 2024-05-02 23:18:12 -03:00
190 changed files with 3794 additions and 3390 deletions

2
.gitignore vendored
View file

@ -18,5 +18,7 @@ lerna-debug.log*
.pnpm-debug.log* .pnpm-debug.log*
*.tsbuildinfo *.tsbuildinfo
src/userplugins
ExtensionCache/ ExtensionCache/
settings/ settings/

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "src/userplugins/vc-message-logger-enhanced"]
path = src/userplugins/vc-message-logger-enhanced
url = https://github.com/Syncxv/vc-message-logger-enhanced.git

View file

@ -90,7 +90,13 @@ export default tseslint.config(
"no-invalid-regexp": "error", "no-invalid-regexp": "error",
"no-constant-condition": ["error", { "checkLoops": false }], "no-constant-condition": ["error", { "checkLoops": false }],
"no-duplicate-imports": "error", "no-duplicate-imports": "error",
"dot-notation": "error", "@typescript-eslint/dot-notation": [
"error",
{
"allowPrivateClassPropertyAccess": true,
"allowProtectedClassPropertyAccess": true
}
],
"no-useless-escape": [ "no-useless-escape": [
"error", "error",
{ {

View file

@ -1,7 +1,7 @@
{ {
"name": "vencord", "name": "vencord",
"private": "true", "private": "true",
"version": "1.10.1", "version": "1.9.8",
"description": "The cutest Discord client mod", "description": "The cutest Discord client mod",
"homepage": "https://github.com/Vendicated/Vencord#readme", "homepage": "https://github.com/Vendicated/Vencord#readme",
"bugs": { "bugs": {
@ -70,7 +70,6 @@
"stylelint": "^16.8.1", "stylelint": "^16.8.1",
"stylelint-config-standard": "^36.0.1", "stylelint-config-standard": "^36.0.1",
"ts-patch": "^3.2.1", "ts-patch": "^3.2.1",
"ts-pattern": "^5.3.1",
"tsx": "^4.16.5", "tsx": "^4.16.5",
"type-fest": "^4.23.0", "type-fest": "^4.23.0",
"typescript": "^5.5.4", "typescript": "^5.5.4",

View file

@ -116,9 +116,6 @@ importers:
ts-patch: ts-patch:
specifier: ^3.2.1 specifier: ^3.2.1
version: 3.2.1 version: 3.2.1
ts-pattern:
specifier: ^5.3.1
version: 5.3.1
tsx: tsx:
specifier: ^4.16.5 specifier: ^4.16.5
version: 4.16.5 version: 4.16.5
@ -2527,9 +2524,6 @@ packages:
resolution: {integrity: sha512-hlR43v+GUIUy8/ZGFP1DquEqPh7PFKQdDMTAmYt671kCCA6AkDQMoeFaFmZ7ObPLYOmpMgyKUqL1C+coFMf30w==} resolution: {integrity: sha512-hlR43v+GUIUy8/ZGFP1DquEqPh7PFKQdDMTAmYt671kCCA6AkDQMoeFaFmZ7ObPLYOmpMgyKUqL1C+coFMf30w==}
hasBin: true hasBin: true
ts-pattern@5.3.1:
resolution: {integrity: sha512-1RUMKa8jYQdNfmnK4jyzBK3/PS/tnjcZ1CW0v1vWDeYe5RBklc/nquw03MEoB66hVBm4BnlCfmOqDVxHyT1DpA==}
tsconfig-paths@3.15.0: tsconfig-paths@3.15.0:
resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
@ -5164,8 +5158,6 @@ snapshots:
semver: 7.6.3 semver: 7.6.3
strip-ansi: 6.0.1 strip-ansi: 6.0.1
ts-pattern@5.3.1: {}
tsconfig-paths@3.15.0: tsconfig-paths@3.15.0:
dependencies: dependencies:
'@types/json5': 0.0.29 '@types/json5': 0.0.29

View file

@ -312,7 +312,7 @@ export const commonOpts = {
logLevel: "info", logLevel: "info",
bundle: true, bundle: true,
watch, watch,
minify: !watch, minify: !watch && !IS_REPORTER,
sourcemap: watch ? "inline" : "", sourcemap: watch ? "inline" : "",
legalComments: "linked", legalComments: "linked",
banner, banner,
@ -334,6 +334,5 @@ export const commonRendererPlugins = [
banImportPlugin(builtinModuleRegex, "Cannot import node inbuilt modules in browser code. You need to use a native.ts file"), banImportPlugin(builtinModuleRegex, "Cannot import node inbuilt modules in browser code. You need to use a native.ts file"),
banImportPlugin(/^react$/, "Cannot import from react. React and hooks should be imported from @webpack/common"), banImportPlugin(/^react$/, "Cannot import from react. React and hooks should be imported from @webpack/common"),
banImportPlugin(/^electron(\/.*)?$/, "Cannot import electron in browser code. You need to use a native.ts file"), banImportPlugin(/^electron(\/.*)?$/, "Cannot import electron in browser code. You need to use a native.ts file"),
banImportPlugin(/^ts-pattern$/, "Cannot import from ts-pattern. match and P should be imported from @webpack/common"),
...commonOpts.plugins ...commonOpts.plugins
]; ];

View file

@ -26,7 +26,7 @@
import { readFileSync } from "fs"; import { readFileSync } from "fs";
import pup, { JSHandle } from "puppeteer-core"; import pup, { JSHandle } from "puppeteer-core";
for (const variable of ["DISCORD_TOKEN", "CHROMIUM_BIN"]) { for (const variable of ["CHROMIUM_BIN"]) {
if (!process.env[variable]) { if (!process.env[variable]) {
console.error(`Missing environment variable ${variable}`); console.error(`Missing environment variable ${variable}`);
process.exit(1); process.exit(1);
@ -214,7 +214,7 @@ page.on("console", async e => {
switch (tag) { switch (tag) {
case "WebpackInterceptor:": case "WebpackInterceptor:":
const patchFailMatch = message.match(/Patch by (.+?) (had no effect|errored|found no module) \(Module id is (.+?)\): (.+)/)!; const patchFailMatch = message.match(/Patch by (.+?) (had no effect|errored|found no module|took [\d.]+?ms) \(Module id is (.+?)\): (.+)/)!;
if (!patchFailMatch) break; if (!patchFailMatch) break;
console.error(await getText()); console.error(await getText());
@ -291,7 +291,7 @@ page.on("error", e => console.error("[Error]", e.message));
page.on("pageerror", e => { page.on("pageerror", e => {
if (e.message.includes("Sentry successfully disabled")) return; if (e.message.includes("Sentry successfully disabled")) return;
if (!e.message.startsWith("Object") && !e.message.includes("Cannot find module")) { if (!e.message.startsWith("Object") && !e.message.includes("Cannot find module") && !/^.{1,2}$/.test(e.message)) {
console.error("[Page Error]", e.message); console.error("[Page Error]", e.message);
report.otherErrors.push(e.message); report.otherErrors.push(e.message);
} else { } else {
@ -299,20 +299,9 @@ page.on("pageerror", e => {
} }
}); });
async function reporterRuntime(token: string) {
Vencord.Webpack.waitFor(
"loginToken",
m => {
console.log("[PUP_DEBUG]", "Logging in with token...");
m.loginToken(token);
}
);
}
await page.evaluateOnNewDocument(` await page.evaluateOnNewDocument(`
if (location.host.endsWith("discord.com")) { if (location.host.endsWith("discord.com")) {
${readFileSync("./dist/browser.js", "utf-8")}; ${readFileSync("./dist/browser.js", "utf-8")};
(${reporterRuntime.toString()})(${JSON.stringify(process.env.DISCORD_TOKEN)});
} }
`); `);

View file

@ -23,10 +23,10 @@ export * as Util from "./utils";
export * as QuickCss from "./utils/quickCss"; export * as QuickCss from "./utils/quickCss";
export * as Updater from "./utils/updater"; export * as Updater from "./utils/updater";
export * as Webpack from "./webpack"; export * as Webpack from "./webpack";
export * as WebpackPatcher from "./webpack/patchWebpack";
export { PlainSettings, Settings }; export { PlainSettings, Settings };
import "./utils/quickCss"; import "./utils/quickCss";
import "./webpack/patchWebpack";
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab"; import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
import { StartAt } from "@utils/types"; import { StartAt } from "@utils/types";
@ -39,7 +39,7 @@ import { localStorage } from "./utils/localStorage";
import { relaunch } from "./utils/native"; import { relaunch } from "./utils/native";
import { getCloudSettings, putCloudSettings } from "./utils/settingsSync"; import { getCloudSettings, putCloudSettings } from "./utils/settingsSync";
import { checkForUpdates, update, UpdateLogger } from "./utils/updater"; import { checkForUpdates, update, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack"; import { onceDiscordLoaded } from "./webpack";
import { SettingsRouter } from "./webpack/common"; import { SettingsRouter } from "./webpack/common";
if (IS_REPORTER) { if (IS_REPORTER) {
@ -86,7 +86,7 @@ async function syncSettings() {
} }
async function init() { async function init() {
await onceReady; await onceDiscordLoaded;
startAllPlugins(StartAt.WebpackReady); startAllPlugins(StartAt.WebpackReady);
syncSettings(); syncSettings();
@ -125,7 +125,7 @@ async function init() {
const pendingPatches = patches.filter(p => !p.all && p.predicate?.() !== false); const pendingPatches = patches.filter(p => !p.all && p.predicate?.() !== false);
if (pendingPatches.length) if (pendingPatches.length)
PMLogger.warn( PMLogger.warn(
"Webpack has finished initialising, but some patches haven't been applied yet.", "Webpack has finished initializing, but some patches haven't been applied yet.",
"This might be expected since some Modules are lazy loaded, but please verify", "This might be expected since some Modules are lazy loaded, but please verify",
"that all plugins are working as intended.", "that all plugins are working as intended.",
"You are seeing this warning because this is a Development build of Vencord.", "You are seeing this warning because this is a Development build of Vencord.",

View file

@ -8,13 +8,12 @@ import "./ChatButton.css";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { waitFor } from "@webpack"; import { findByProps } from "@webpack";
import { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from "@webpack/common"; import { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from "@webpack/common";
import { Channel } from "discord-types/general"; import { Channel } from "discord-types/general";
import { HTMLProps, MouseEventHandler, ReactNode } from "react"; import { HTMLProps, MouseEventHandler, ReactNode } from "react";
let ChannelTextAreaClasses: Record<"button" | "buttonContainer", string>; const ChannelTextAreaClasses = findByProps<Record<"button" | "buttonContainer", string>>("buttonContainer", "channelTextArea");
waitFor(["buttonContainer", "channelTextArea"], m => ChannelTextAreaClasses = m);
export interface ChatBarProps { export interface ChatBarProps {
channel: Channel; channel: Channel;

View file

@ -17,14 +17,14 @@
*/ */
import { mergeDefaults } from "@utils/mergeDefaults"; import { mergeDefaults } from "@utils/mergeDefaults";
import { findByCodeLazy } from "@webpack"; import { findByCode } from "@webpack";
import { MessageActions, SnowflakeUtils } from "@webpack/common"; import { MessageActions, SnowflakeUtils } from "@webpack/common";
import { Message } from "discord-types/general"; import { Message } from "discord-types/general";
import type { PartialDeep } from "type-fest"; import type { PartialDeep } from "type-fest";
import { Argument } from "./types"; import { Argument } from "./types";
const createBotMessage = findByCodeLazy('username:"Clyde"'); const createBotMessage = findByCode('username:"Clyde"');
export function generateId() { export function generateId() {
return `-${SnowflakeUtils.fromTimestamp(Date.now())}`; return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;

View file

@ -16,7 +16,6 @@
* 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 { Logger } from "@utils/Logger";
import { makeCodeblock } from "@utils/text"; import { makeCodeblock } from "@utils/text";
import { sendBotMessage } from "./commandHelpers"; import { sendBotMessage } from "./commandHelpers";
@ -47,10 +46,10 @@ export let RequiredMessageOption: Option = ReqPlaceholder;
export const _init = function (cmds: Command[]) { export const _init = function (cmds: Command[]) {
try { try {
BUILT_IN = cmds; BUILT_IN = cmds;
OptionalMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "shrug")!.options![0]; OptionalMessageOption = cmds.find(c => c.name === "shrug")!.options![0];
RequiredMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "me")!.options![0]; RequiredMessageOption = cmds.find(c => c.name === "me")!.options![0];
} catch (e) { } catch (e) {
new Logger("CommandsAPI").error("Failed to load CommandsApi", e, " - cmds is", cmds); console.error("Failed to load CommandsApi");
} }
return cmds; return cmds;
} as never; } as never;
@ -139,8 +138,6 @@ export function registerCommand<C extends Command>(command: C, plugin: string) {
throw new Error(`Command '${command.name}' already exists.`); throw new Error(`Command '${command.name}' already exists.`);
command.isVencordCommand = true; command.isVencordCommand = true;
command.untranslatedName ??= command.name;
command.untranslatedDescription ??= command.description;
command.id ??= `-${BUILT_IN.length + 1}`; command.id ??= `-${BUILT_IN.length + 1}`;
command.applicationId ??= "-1"; // BUILT_IN; command.applicationId ??= "-1"; // BUILT_IN;
command.type ??= ApplicationCommandType.CHAT_INPUT; command.type ??= ApplicationCommandType.CHAT_INPUT;

View file

@ -93,10 +93,8 @@ export interface Command {
isVencordCommand?: boolean; isVencordCommand?: boolean;
name: string; name: string;
untranslatedName?: string;
displayName?: string; displayName?: string;
description: string; description: string;
untranslatedDescription?: string;
displayDescription?: string; displayDescription?: string;
options?: Option[]; options?: Option[];

View file

@ -16,23 +16,22 @@
* 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 { waitFor } from "@webpack"; import { find } from "@webpack";
let NoticesModule: any; const Notices = find(m => m.show && m.dismiss && !m.suppressAll);
waitFor(m => m.show && m.dismiss && !m.suppressAll, m => NoticesModule = m);
export const noticesQueue = [] as any[]; export const noticesQueue = [] as any[];
export let currentNotice: any = null; export let currentNotice: any = null;
export function popNotice() { export function popNotice() {
NoticesModule.dismiss(); Notices.dismiss();
} }
export function nextNotice() { export function nextNotice() {
currentNotice = noticesQueue.shift(); currentNotice = noticesQueue.shift();
if (currentNotice) { if (currentNotice) {
NoticesModule.show(...currentNotice, "VencordNotice"); Notices.show(...currentNotice, "VencordNotice");
} }
} }

View file

@ -32,9 +32,10 @@ export interface Settings {
autoUpdate: boolean; autoUpdate: boolean;
autoUpdateNotification: boolean, autoUpdateNotification: boolean,
useQuickCss: boolean; useQuickCss: boolean;
enableReactDevtools: boolean;
themeLinks: string[]; themeLinks: string[];
eagerPatches: boolean;
enabledThemes: string[]; enabledThemes: string[];
enableReactDevtools: boolean;
frameless: boolean; frameless: boolean;
transparent: boolean; transparent: boolean;
winCtrlQ: boolean; winCtrlQ: boolean;
@ -81,6 +82,7 @@ const DefaultSettings: Settings = {
autoUpdateNotification: true, autoUpdateNotification: true,
useQuickCss: true, useQuickCss: true,
themeLinks: [], themeLinks: [],
eagerPatches: IS_REPORTER,
enabledThemes: [], enabledThemes: [],
enableReactDevtools: false, enableReactDevtools: false,
frameless: false, frameless: false,
@ -116,7 +118,6 @@ const saveSettingsOnFrequentAction = debounce(async () => {
} }
}, 60_000); }, 60_000);
export const SettingsStore = new SettingsStoreClass(settings, { export const SettingsStore = new SettingsStoreClass(settings, {
readOnly: true, readOnly: true,
getDefaultValue({ getDefaultValue({

View file

@ -89,8 +89,8 @@ export const isStyleEnabled = (name: string) => requireStyle(name).dom?.isConnec
* // -- plugin.ts -- * // -- plugin.ts --
* import pluginStyle from "./plugin.css?managed"; * import pluginStyle from "./plugin.css?managed";
* import { setStyleVars } from "@api/Styles"; * import { setStyleVars } from "@api/Styles";
* import { findByPropsLazy } from "@webpack"; * import { findByProps } from "@webpack";
* const classNames = findByPropsLazy("thin", "scrollerBase"); // { thin: "thin-31rlnD scrollerBase-_bVAAt", ... } * const classNames = findByProps("thin", "scrollerBase"); // { thin: "thin-31rlnD scrollerBase-_bVAAt", ... }
* *
* // Inside some plugin method like "start()" * // Inside some plugin method like "start()"
* setStyleClassNames(pluginStyle, classNames); * setStyleClassNames(pluginStyle, classNames);

View file

@ -17,8 +17,7 @@
*/ */
import { proxyLazy } from "@utils/lazy"; import { proxyLazy } from "@utils/lazy";
import { Logger } from "@utils/Logger"; import { findByFactoryCode } from "@webpack";
import { findModuleId, proxyLazyWebpack, wreq } from "@webpack";
interface UserSettingDefinition<T> { interface UserSettingDefinition<T> {
/** /**
@ -43,12 +42,7 @@ interface UserSettingDefinition<T> {
userSettingsAPIName: string; userSettingsAPIName: string;
} }
export const UserSettings: Record<PropertyKey, UserSettingDefinition<any>> | undefined = proxyLazyWebpack(() => { export const UserSettings = findByFactoryCode<Record<PropertyKey, UserSettingDefinition<any>>>('"textAndImages","renderSpoilers"');
const modId = findModuleId('"textAndImages","renderSpoilers"');
if (modId == null) return new Logger("UserSettingsAPI ").error("Didn't find settings module.");
return wreq(modId as any);
});
/** /**
* Get the setting with the given setting group and name. * Get the setting with the given setting group and name.
@ -56,7 +50,7 @@ export const UserSettings: Record<PropertyKey, UserSettingDefinition<any>> | und
* @param group The setting group * @param group The setting group
* @param name The name of the setting * @param name The name of the setting
*/ */
export function getUserSetting<T = any>(group: string, name: string): UserSettingDefinition<T> | undefined { export function getUserSetting<T = any>(group: string, name: string): UserSettingDefinition<T> {
if (!Vencord.Plugins.isPluginEnabled("UserSettingsAPI")) throw new Error("Cannot use UserSettingsAPI without setting as dependency."); if (!Vencord.Plugins.isPluginEnabled("UserSettingsAPI")) throw new Error("Cannot use UserSettingsAPI without setting as dependency.");
for (const key in UserSettings) { for (const key in UserSettings) {
@ -66,10 +60,12 @@ export function getUserSetting<T = any>(group: string, name: string): UserSettin
return userSetting; return userSetting;
} }
} }
throw new Error(`UserSettingsAPI: Setting ${group}.${name} not found.`);
} }
/** /**
* {@link getUserSettingDefinition}, lazy. * Lazy version of {@link getUserSetting}
* *
* Get the setting with the given setting group and name. * Get the setting with the given setting group and name.
* *

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { Parser } from "@webpack/common"; import { Parser } from "@webpack/common";
const CodeContainerClasses = findByPropsLazy("markup", "codeContainer"); const CodeContainerClasses = findByProps("markup", "codeContainer");
/** /**
* Renders code in a Discord codeblock * Renders code in a Discord codeblock

View file

@ -65,7 +65,8 @@ export function LinkIcon({ height = 24, width = 24, className }: IconProps) {
} }
/** /**
* Discord's copy icon, as seen in the user panel popout on the right of the username and in large code blocks * Discord's copy icon, as seen in the user popout right of the username when clicking
* your own username in the bottom left user panel
*/ */
export function CopyIcon(props: IconProps) { export function CopyIcon(props: IconProps) {
return ( return (
@ -75,9 +76,8 @@ export function CopyIcon(props: IconProps) {
viewBox="0 0 24 24" viewBox="0 0 24 24"
> >
<g fill="currentColor"> <g fill="currentColor">
<path d="M3 16a1 1 0 0 1-1-1v-5a8 8 0 0 1 8-8h5a1 1 0 0 1 1 1v.5a.5.5 0 0 1-.5.5H10a6 6 0 0 0-6 6v5.5a.5.5 0 0 1-.5.5H3Z" /> <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1z" />
<path d="M6 18a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-4h-3a5 5 0 0 1-5-5V6h-4a4 4 0 0 0-4 4v8Z" /> <path d="M15 5H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z" />
<path d="M21.73 12a3 3 0 0 0-.6-.88l-4.25-4.24a3 3 0 0 0-.88-.61V9a3 3 0 0 0 3 3h2.73Z" />
</g> </g>
</Icon> </Icon>
); );

View file

@ -24,13 +24,12 @@ import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { gitRemote } from "@shared/vencordUserAgent"; import { gitRemote } from "@shared/vencordUserAgent";
import { proxyLazy } from "@utils/lazy";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { classes, isObjectEmpty } from "@utils/misc"; import { classes, isObjectEmpty } from "@utils/misc";
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { OptionType, Plugin } from "@utils/types"; import { OptionType, Plugin } from "@utils/types";
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { find, findByProps, findComponentByCode } from "@webpack";
import { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "@webpack/common"; import { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserUtils } from "@webpack/common";
import { User } from "discord-types/general"; import { User } from "discord-types/general";
import { Constructor } from "type-fest"; import { Constructor } from "type-fest";
@ -50,9 +49,9 @@ import { GithubButton, WebsiteButton } from "./LinkIconButton";
const cl = classNameFactory("vc-plugin-modal-"); const cl = classNameFactory("vc-plugin-modal-");
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers"); const UserSummaryItem = findComponentByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers");
const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar"); const AvatarStyles = findByProps("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
const UserRecord: Constructor<Partial<User>> = proxyLazy(() => UserStore.getCurrentUser().constructor) as any; const UserRecord = find<Constructor<Partial<User>>>(m => m?.prototype?.getAvatarURL && m?.prototype?.hasHadPremium);
interface PluginModalProps extends ModalProps { interface PluginModalProps extends ModalProps {
plugin: Plugin; plugin: Plugin;

View file

@ -33,19 +33,19 @@ import { Margins } from "@utils/margins";
import { classes, isObjectEmpty } from "@utils/misc"; import { classes, isObjectEmpty } from "@utils/misc";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import { Plugin } from "@utils/types"; import { Plugin } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip, useMemo } from "@webpack/common"; import { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip, useMemo } from "@webpack/common";
import Plugins, { ExcludedPlugins } from "~plugins"; import Plugins, { ExcludedPlugins } from "~plugins";
// Avoid circular dependency // Avoid circular dependency
const { startDependenciesRecursive, startPlugin, stopPlugin } = proxyLazy(() => require("../../plugins")); const PluginManager = proxyLazy(() => require("../../plugins")) as typeof import("../../plugins");
const cl = classNameFactory("vc-plugins-"); const cl = classNameFactory("vc-plugins-");
const logger = new Logger("PluginSettings", "#a6d189"); const logger = new Logger("PluginSettings", "#a6d189");
const InputStyles = findByPropsLazy("inputWrapper", "inputDefault", "error"); const InputStyles = findByProps("inputWrapper", "inputDefault", "error");
const ButtonClasses = findByPropsLazy("button", "disabled", "enabled"); const ButtonClasses = findByProps("button", "disabled", "enabled");
function showErrorToast(message: string) { function showErrorToast(message: string) {
@ -100,7 +100,7 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on
// If we're enabling a plugin, make sure all deps are enabled recursively. // If we're enabling a plugin, make sure all deps are enabled recursively.
if (!wasEnabled) { if (!wasEnabled) {
const { restartNeeded, failures } = startDependenciesRecursive(plugin); const { restartNeeded, failures } = PluginManager.startDependenciesRecursive(plugin);
if (failures.length) { if (failures.length) {
logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(", ")}`); logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(", ")}`);
showNotice("Failed to start dependencies: " + failures.join(", "), "Close", () => null); showNotice("Failed to start dependencies: " + failures.join(", "), "Close", () => null);
@ -126,7 +126,7 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on
return; return;
} }
const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin); const result = wasEnabled ? PluginManager.stopPlugin(plugin) : PluginManager.startPlugin(plugin);
if (!result) { if (!result) {
settings.enabled = false; settings.enabled = false;

View file

@ -19,7 +19,7 @@
import "./Switch.css"; import "./Switch.css";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
interface SwitchProps { interface SwitchProps {
checked: boolean; checked: boolean;
@ -29,7 +29,7 @@ interface SwitchProps {
const SWITCH_ON = "var(--green-360)"; const SWITCH_ON = "var(--green-360)";
const SWITCH_OFF = "var(--primary-400)"; const SWITCH_OFF = "var(--primary-400)";
const SwitchClasses = findByPropsLazy("slider", "input", "container"); const SwitchClasses = findByProps("slider", "input", "container");
export function Switch({ checked, onChange, disabled }: SwitchProps) { export function Switch({ checked, onChange, disabled }: SwitchProps) {
return ( return (

View file

@ -22,7 +22,7 @@ import { Margins } from "@utils/margins";
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches"; import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
import { makeCodeblock } from "@utils/text"; import { makeCodeblock } from "@utils/text";
import { Patch, ReplaceFn } from "@utils/types"; import { Patch, ReplaceFn } from "@utils/types";
import { search } from "@webpack"; import { searchFactories } from "@webpack";
import { Button, Clipboard, Forms, Parser, React, Switch, TextArea, TextInput } from "@webpack/common"; import { Button, Clipboard, Forms, Parser, React, Switch, TextArea, TextInput } from "@webpack/common";
import { SettingsTab, wrapTab } from "./shared"; import { SettingsTab, wrapTab } from "./shared";
@ -33,7 +33,7 @@ if (IS_DEV) {
} }
const findCandidates = debounce(function ({ find, setModule, setError }) { const findCandidates = debounce(function ({ find, setModule, setError }) {
const candidates = search(find); const candidates = searchFactories(find);
const keys = Object.keys(candidates); const keys = Object.keys(candidates);
const len = keys.length; const len = keys.length;
if (len === 0) if (len === 0)
@ -56,7 +56,7 @@ function ReplacementComponent({ module, match, replacement, setReplacementError
const [compileResult, setCompileResult] = React.useState<[boolean, string]>(); const [compileResult, setCompileResult] = React.useState<[boolean, string]>();
const [patchedCode, matchResult, diff] = React.useMemo(() => { const [patchedCode, matchResult, diff] = React.useMemo(() => {
const src: string = fact.toString().replaceAll("\n", ""); const src = String(fact).replaceAll("\n", "");
try { try {
new RegExp(match); new RegExp(match);
@ -382,7 +382,6 @@ function PatchHelper() {
<Forms.FormTitle className={Margins.top20}>Code</Forms.FormTitle> <Forms.FormTitle className={Margins.top20}>Code</Forms.FormTitle>
<CodeBlock lang="js" content={code} /> <CodeBlock lang="js" content={code} />
<Button onClick={() => Clipboard.copy(code)}>Copy to Clipboard</Button> <Button onClick={() => Clipboard.copy(code)}>Copy to Clipboard</Button>
<Button className={Margins.top8} onClick={() => Clipboard.copy("```ts\n" + code + "\n```")}>Copy as Codeblock</Button>
</> </>
)} )}
</SettingsTab> </SettingsTab>

View file

@ -16,7 +16,7 @@
* 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, useSettings } from "@api/Settings"; import { useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles"; import { classNameFactory } from "@api/Styles";
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { DeleteIcon, FolderIcon, PaintbrushIcon, PencilIcon, PlusIcon, RestartIcon } from "@components/Icons"; import { DeleteIcon, FolderIcon, PaintbrushIcon, PencilIcon, PlusIcon, RestartIcon } from "@components/Icons";
@ -27,9 +27,9 @@ import { openInviteModal } from "@utils/discord";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { showItemInFolder } from "@utils/native"; import { showItemInFolder } from "@utils/native";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import { findLazy } from "@webpack"; import { findComponentByFields } from "@webpack";
import { Card, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from "@webpack/common"; import { Card, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from "@webpack/common";
import type { ComponentType, Ref, SyntheticEvent } from "react"; import type { Ref, SyntheticEvent } from "react";
import Plugins from "~plugins"; import Plugins from "~plugins";
@ -37,14 +37,14 @@ import { AddonCard } from "./AddonCard";
import { QuickAction, QuickActionCard } from "./quickActions"; import { QuickAction, QuickActionCard } from "./quickActions";
import { SettingsTab, wrapTab } from "./shared"; import { SettingsTab, wrapTab } from "./shared";
type FileInput = ComponentType<{ type FileInputProps = {
ref: Ref<HTMLInputElement>; ref: Ref<HTMLInputElement>;
onChange: (e: SyntheticEvent<HTMLInputElement>) => void; onChange: (e: SyntheticEvent<HTMLInputElement>) => void;
multiple?: boolean; multiple?: boolean;
filters?: { name?: string; extensions: string[]; }[]; filters?: { name?: string; extensions: string[]; }[];
}>; };
const FileInput: FileInput = findLazy(m => m.prototype?.activateUploadDialogue && m.prototype.setRef); const FileInput = findComponentByFields<FileInputProps>("activateUploadDialogue", "setRef");
const cl = classNameFactory("vc-settings-theme-"); const cl = classNameFactory("vc-settings-theme-");
@ -77,16 +77,8 @@ function Validators({ themeLinks }: { themeLinks: string[]; }) {
<Forms.FormTitle className={Margins.top20} tag="h5">Validator</Forms.FormTitle> <Forms.FormTitle className={Margins.top20} tag="h5">Validator</Forms.FormTitle>
<Forms.FormText>This section will tell you whether your themes can successfully be loaded</Forms.FormText> <Forms.FormText>This section will tell you whether your themes can successfully be loaded</Forms.FormText>
<div> <div>
{themeLinks.map(rawLink => { {themeLinks.map(link => (
const { label, link } = (() => { <Card style={{
const match = /^@(light|dark) (.*)/.exec(rawLink);
if (!match) return { label: rawLink, link: rawLink };
const [, mode, link] = match;
return { label: `[${mode} mode only] ${link}`, link };
})();
return <Card style={{
padding: ".5em", padding: ".5em",
marginBottom: ".5em", marginBottom: ".5em",
marginTop: ".5em" marginTop: ".5em"
@ -94,11 +86,11 @@ function Validators({ themeLinks }: { themeLinks: string[]; }) {
<Forms.FormTitle tag="h5" style={{ <Forms.FormTitle tag="h5" style={{
overflowWrap: "break-word" overflowWrap: "break-word"
}}> }}>
{label} {link}
</Forms.FormTitle> </Forms.FormTitle>
<Validator link={link} /> <Validator link={link} />
</Card>; </Card>
})} ))}
</div> </div>
</> </>
); );
@ -257,7 +249,7 @@ function ThemesTab() {
Icon={PaintbrushIcon} Icon={PaintbrushIcon}
/> />
{Settings.plugins.ClientTheme.enabled && ( {Vencord.Plugins.isPluginEnabled("ClientTheme") && (
<QuickAction <QuickAction
text="Edit ClientTheme" text="Edit ClientTheme"
action={() => openPluginModal(Plugins.ClientTheme)} action={() => openPluginModal(Plugins.ClientTheme)}
@ -304,7 +296,6 @@ function ThemesTab() {
<Card className="vc-settings-card vc-text-selectable"> <Card className="vc-settings-card vc-text-selectable">
<Forms.FormTitle tag="h5">Paste links to css files here</Forms.FormTitle> <Forms.FormTitle tag="h5">Paste links to css files here</Forms.FormTitle>
<Forms.FormText>One link per line</Forms.FormText> <Forms.FormText>One link per line</Forms.FormText>
<Forms.FormText>You can prefix lines with @light or @dark to toggle them based on your Discord theme</Forms.FormText>
<Forms.FormText>Make sure to use direct links to files (raw or github.io)!</Forms.FormText> <Forms.FormText>Make sure to use direct links to files (raw or github.io)!</Forms.FormText>
</Card> </Card>

View file

@ -23,35 +23,61 @@ if (IS_DEV || IS_REPORTER) {
var logger = new Logger("Tracer", "#FFD166"); var logger = new Logger("Tracer", "#FFD166");
} }
const noop = function () { }; export const beginTrace = !(IS_DEV || IS_REPORTER) ? () => { } :
export const beginTrace = !(IS_DEV || IS_REPORTER) ? noop :
function beginTrace(name: string, ...args: any[]) { function beginTrace(name: string, ...args: any[]) {
if (name in traces) if (name in traces) {
throw new Error(`Trace ${name} already exists!`); throw new Error(`Trace ${name} already exists!`);
}
traces[name] = [performance.now(), args]; traces[name] = [performance.now(), args];
}; };
export const finishTrace = !(IS_DEV || IS_REPORTER) ? noop : function finishTrace(name: string) { export const finishTrace = !(IS_DEV || IS_REPORTER) ? () => 0 :
function finishTrace(name: string) {
const end = performance.now(); const end = performance.now();
const [start, args] = traces[name]; const [start, args] = traces[name];
delete traces[name]; delete traces[name];
logger.debug(`${name} took ${end - start}ms`, args); const totalTime = end - start;
logger.debug(`${name} took ${totalTime}ms`, args);
return totalTime;
}; };
type Func = (...args: any[]) => any; type Func = (...args: any[]) => any;
type TraceNameMapper<F extends Func> = (...args: Parameters<F>) => string; type TraceNameMapper<F extends Func> = (...args: Parameters<F>) => string;
const noopTracer = function noopTracerWithResults<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>) {
<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>) => f; return function (this: unknown, ...args: Parameters<F>): [ReturnType<F>, number] {
return [f.apply(this, args), 0];
};
}
function noopTracer<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>) {
return f;
}
export const traceFunctionWithResults = !(IS_DEV || IS_REPORTER)
? noopTracerWithResults
: function traceFunctionWithResults<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>): (this: unknown, ...args: Parameters<F>) => [ReturnType<F>, number] {
return function (this: unknown, ...args: Parameters<F>) {
const traceName = mapper?.(...args) ?? name;
beginTrace(traceName, ...arguments);
try {
return [f.apply(this, args), finishTrace(traceName)];
} catch (e) {
finishTrace(traceName);
throw e;
}
};
};
export const traceFunction = !(IS_DEV || IS_REPORTER) export const traceFunction = !(IS_DEV || IS_REPORTER)
? noopTracer ? noopTracer
: function traceFunction<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>): F { : function traceFunction<F extends Func>(name: string, f: F, mapper?: TraceNameMapper<F>): F {
return function (this: any, ...args: Parameters<F>) { return function (this: unknown, ...args: Parameters<F>) {
const traceName = mapper?.(...args) ?? name; const traceName = mapper?.(...args) ?? name;
beginTrace(traceName, ...arguments); beginTrace(traceName, ...arguments);

View file

@ -8,10 +8,11 @@ import { Logger } from "@utils/Logger";
import { canonicalizeMatch } from "@utils/patches"; import { canonicalizeMatch } from "@utils/patches";
import * as Webpack from "@webpack"; import * as Webpack from "@webpack";
import { wreq } from "@webpack"; import { wreq } from "@webpack";
import { AnyModuleFactory, ModuleFactory } from "webpack";
const LazyChunkLoaderLogger = new Logger("LazyChunkLoader");
export async function loadLazyChunks() { export async function loadLazyChunks() {
const LazyChunkLoaderLogger = new Logger("LazyChunkLoader");
try { try {
LazyChunkLoaderLogger.log("Loading all chunks..."); LazyChunkLoaderLogger.log("Loading all chunks...");
@ -25,16 +26,12 @@ export async function loadLazyChunks() {
// True if resolved, false otherwise // True if resolved, false otherwise
const chunksSearchPromises = [] as Array<() => boolean>; const chunksSearchPromises = [] as Array<() => boolean>;
const LazyChunkRegex = canonicalizeMatch(/(?:(?:Promise\.all\(\[)?(\i\.e\("?[^)]+?"?\)[^\]]*?)(?:\]\))?)\.then\(\i\.bind\(\i,"?([^)]+?)"?\)\)/g); const LazyChunkRegex = canonicalizeMatch(/(?:(?:Promise\.all\(\[)?(\i\.e\("?[^)]+?"?\)[^\]]*?)(?:\]\))?)\.then\(\i(?:\.\i)?\.bind\(\i,"?([^)]+?)"?(?:,[^)]+?)?\)\)/g);
async function searchAndLoadLazyChunks(factoryCode: string) { async function searchAndLoadLazyChunks(factoryCode: string) {
const lazyChunks = factoryCode.matchAll(LazyChunkRegex); const lazyChunks = factoryCode.matchAll(LazyChunkRegex);
const validChunkGroups = new Set<[chunkIds: number[], entryPoint: number]>(); const validChunkGroups = new Set<[chunkIds: number[], entryPoint: number]>();
// Workaround for a chunk that depends on the ChannelMessage component but may be be force loaded before
// the chunk containing the component
const shouldForceDefer = factoryCode.includes(".Messages.GUILD_FEED_UNFEATURE_BUTTON_TEXT");
await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => { await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => {
const chunkIds = rawChunkIds ? Array.from(rawChunkIds.matchAll(Webpack.ChunkIdsRegex)).map(m => Number(m[1])) : []; const chunkIds = rawChunkIds ? Array.from(rawChunkIds.matchAll(Webpack.ChunkIdsRegex)).map(m => Number(m[1])) : [];
@ -69,19 +66,14 @@ export async function loadLazyChunks() {
await Promise.all( await Promise.all(
Array.from(validChunkGroups) Array.from(validChunkGroups)
.map(([chunkIds]) => .map(([chunkIds]) =>
Promise.all(chunkIds.map(id => wreq.e(id as any).catch(() => { }))) Promise.all(chunkIds.map(id => wreq.e(id)))
) )
); );
// Requires the entry points for all valid chunk groups // Requires the entry points for all valid chunk groups
for (const [, entryPoint] of validChunkGroups) { for (const [, entryPoint] of validChunkGroups) {
try { try {
if (shouldForceDefer) { if (wreq.m[entryPoint]) wreq(entryPoint);
deferredRequires.add(entryPoint);
continue;
}
if (wreq.m[entryPoint]) wreq(entryPoint as any);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -109,32 +101,33 @@ export async function loadLazyChunks() {
}, 0); }, 0);
} }
Webpack.factoryListeners.add(factory => { function factoryListener(factory: AnyModuleFactory | ModuleFactory) {
let isResolved = false; let isResolved = false;
searchAndLoadLazyChunks(factory.toString()).then(() => isResolved = true); searchAndLoadLazyChunks(String(factory))
.then(() => isResolved = true)
chunksSearchPromises.push(() => isResolved); .catch(() => isResolved = true);
});
for (const factoryId in wreq.m) {
let isResolved = false;
searchAndLoadLazyChunks(wreq.m[factoryId].toString()).then(() => isResolved = true);
chunksSearchPromises.push(() => isResolved); chunksSearchPromises.push(() => isResolved);
} }
Webpack.factoryListeners.add(factoryListener);
for (const factoryId in wreq.m) {
factoryListener(wreq.m[factoryId]);
}
await chunksSearchingDone; await chunksSearchingDone;
Webpack.factoryListeners.delete(factoryListener);
// Require deferred entry points // Require deferred entry points
for (const deferredRequire of deferredRequires) { for (const deferredRequire of deferredRequires) {
wreq!(deferredRequire as any); wreq(deferredRequire);
} }
// All chunks Discord has mapped to asset files, even if they are not used anymore // All chunks Discord has mapped to asset files, even if they are not used anymore
const allChunks = [] as number[]; const allChunks = [] as number[];
// Matches "id" or id: // Matches "id" or id:
for (const currentMatch of wreq!.u.toString().matchAll(/(?:"([\deE]+?)"(?![,}]))|(?:([\deE]+?):)/g)) { for (const currentMatch of String(wreq.u).matchAll(/(?:"([\deE]+?)"(?![,}]))|(?:([\deE]+?):)/g)) {
const id = currentMatch[1] ?? currentMatch[2]; const id = currentMatch[1] ?? currentMatch[2];
if (id == null) continue; if (id == null) continue;
@ -143,7 +136,8 @@ export async function loadLazyChunks() {
if (allChunks.length === 0) throw new Error("Failed to get all chunks"); if (allChunks.length === 0) throw new Error("Failed to get all chunks");
// Chunks that are not loaded (not used) by Discord code anymore // Chunks which our regex could not catch to load
// It will always contain WebWorker assets, and also currently contains some language packs which are loaded differently
const chunksLeft = allChunks.filter(id => { const chunksLeft = allChunks.filter(id => {
return !(validChunks.has(id) || invalidChunks.has(id)); return !(validChunks.has(id) || invalidChunks.has(id));
}); });
@ -153,12 +147,9 @@ export async function loadLazyChunks() {
.then(r => r.text()) .then(r => r.text())
.then(t => t.includes("importScripts(")); .then(t => t.includes("importScripts("));
// Loads and requires a chunk // Loads the chunk. Currently this only happens with the language packs which are loaded differently
if (!isWorkerAsset) { if (!isWorkerAsset) {
await wreq.e(id as any); await wreq.e(id);
// Technically, the id of the chunk does not match the entry point
// But, still try it because we have no way to get the actual entry point
if (wreq.m[id]) wreq(id as any);
} }
})); }));

View file

@ -4,22 +4,39 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import { SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { SYM_PROXY_INNER_GET, SYM_PROXY_INNER_VALUE } from "@utils/proxyInner";
import * as Webpack from "@webpack"; import * as Webpack from "@webpack";
import { patches } from "plugins"; import { addPatch, patches } from "plugins";
import { loadLazyChunks } from "./loadLazyChunks"; import { loadLazyChunks } from "./loadLazyChunks";
async function runReporter() {
const ReporterLogger = new Logger("Reporter"); const ReporterLogger = new Logger("Reporter");
async function runReporter() {
try { try {
ReporterLogger.log("Starting test..."); ReporterLogger.log("Starting test...");
let loadLazyChunksResolve: (value: void | PromiseLike<void>) => void; let loadLazyChunksResolve: (value: void) => void;
const loadLazyChunksDone = new Promise<void>(r => loadLazyChunksResolve = r); const loadLazyChunksDone = new Promise<void>(r => loadLazyChunksResolve = r);
Webpack.beforeInitListeners.add(() => loadLazyChunks().then((loadLazyChunksResolve))); // The main patch for starting the reporter chunk loading
addPatch({
find: '"Could not find app-mount"',
replacement: {
match: /(?<="use strict";)/,
replace: "Vencord.Webpack._initReporter();"
}
}, "Vencord Reporter");
// @ts-ignore
Vencord.Webpack._initReporter = function () {
// initReporter is called in the patched entry point of Discord
// setImmediate to only start searching for lazy chunks after Discord initialized the app
setTimeout(() => loadLazyChunks().then(loadLazyChunksResolve), 0);
};
await loadLazyChunksDone; await loadLazyChunksDone;
for (const patch of patches) { for (const patch of patches) {
@ -28,52 +45,158 @@ async function runReporter() {
} }
} }
for (const [searchType, args] of Webpack.lazyWebpackSearchHistory) { for (const [plugin, moduleId, match, totalTime] of Vencord.WebpackPatcher.patchTimings) {
let method = searchType; if (totalTime > 3) {
new Logger("WebpackInterceptor").warn(`Patch by ${plugin} took ${totalTime}ms (Module id is ${String(moduleId)}): ${match}`);
if (searchType === "findComponent") method = "find"; }
if (searchType === "findExportedComponent") method = "findByProps";
if (searchType === "waitFor" || searchType === "waitForComponent") {
if (typeof args[0] === "string") method = "findByProps";
else method = "find";
} }
if (searchType === "waitForStore") method = "findStore";
let result: any; await Promise.all(Webpack.webpackSearchHistory.map(async ([searchType, args]) => {
args = [...args];
let result = null as any;
try { try {
if (method === "proxyLazyWebpack" || method === "LazyComponentWebpack") { switch (searchType) {
case "webpackDependantLazy":
case "webpackDependantLazyComponent": {
const [factory] = args; const [factory] = args;
result = factory(); result = factory();
} else if (method === "extractAndLoadChunks") { break;
const [code, matcher] = args; }
case "extractAndLoadChunks": {
const extractAndLoadChunks = args.shift();
result = await Webpack.extractAndLoadChunks(code, matcher); result = await extractAndLoadChunks();
if (result === false) result = null; if (result === false) {
} else if (method === "mapMangledModule") { result = null;
const [code, mapper] = args;
result = Webpack.mapMangledModule(code, mapper);
if (Object.keys(result).length !== Object.keys(mapper).length) throw new Error("Webpack Find Fail");
} else {
// @ts-ignore
result = Webpack[method](...args);
} }
if (result == null || (result.$$vencordInternal != null && result.$$vencordInternal() == null)) throw new Error("Webpack Find Fail"); break;
}
default: {
const findResult = args.shift();
if (findResult != null) {
if (findResult.$$vencordCallbackCalled != null && findResult.$$vencordCallbackCalled()) {
result = findResult;
break;
}
if (findResult[SYM_PROXY_INNER_GET] != null) {
result = findResult[SYM_PROXY_INNER_VALUE];
break;
}
if (findResult[SYM_LAZY_COMPONENT_INNER] != null) {
result = findResult[SYM_LAZY_COMPONENT_INNER]();
break;
}
if (searchType === "mapMangledModule") {
result = findResult;
for (const innerMap in result) {
if (
(result[innerMap][SYM_PROXY_INNER_GET] != null && result[innerMap][SYM_PROXY_INNER_VALUE] == null) ||
(result[innerMap][SYM_LAZY_COMPONENT_INNER] != null && result[innerMap][SYM_LAZY_COMPONENT_INNER]() == null)
) {
throw new Error("Webpack Find Fail");
}
}
break;
}
// This can happen if a `find` was immediately found
result = findResult;
}
break;
}
}
if (result == null) {
throw new Error("Webpack Find Fail");
}
} catch (e) { } catch (e) {
let logMessage = searchType; let logMessage = searchType;
if (method === "find" || method === "proxyLazyWebpack" || method === "LazyComponentWebpack") logMessage += `(${args[0].toString().slice(0, 147)}...)`;
else if (method === "extractAndLoadChunks") logMessage += `([${args[0].map(arg => `"${arg}"`).join(", ")}], ${args[1].toString()})`;
else if (method === "mapMangledModule") {
const failedMappings = Object.keys(args[1]).filter(key => result?.[key] == null);
logMessage += `("${args[0]}", {\n${failedMappings.map(mapping => `\t${mapping}: ${args[1][mapping].toString().slice(0, 147)}...`).join(",\n")}\n})`; let filterName = "";
let parsedArgs = args;
if (args[0].$$vencordProps != null) {
if (["find", "findComponent", "waitFor"].includes(searchType)) {
filterName = args[0].$$vencordProps[0];
parsedArgs = args[0].$$vencordProps.slice(1);
} else {
parsedArgs = args[0].$$vencordProps;
}
}
function stringifyFilter(code: Webpack.CodeFilterWithSingle) {
if (Array.isArray(code)) {
return `[${code.map(arg => arg instanceof RegExp ? String(arg) : JSON.stringify(arg)).join(", ")}]`;
}
return code instanceof RegExp ? String(code) : JSON.stringify(code);
}
// if parsedArgs is the same as args, it means vencordProps of the filter was not available (like in normal filter functions),
// so log the filter function instead
if (
parsedArgs === args &&
["waitFor", "find", "findComponent", "webpackDependantLazy", "webpackDependantLazyComponent"].includes(searchType)
) {
let filter = String(parsedArgs[0]);
if (filter.length > 150) {
filter = filter.slice(0, 147) + "...";
}
logMessage += `(${filter})`;
} else if (searchType === "extractAndLoadChunks") {
const [code, matcher] = parsedArgs;
let regexStr: string;
if (matcher === Webpack.DefaultExtractAndLoadChunksRegex) {
regexStr = "DefaultExtractAndLoadChunksRegex";
} else {
regexStr = String(matcher);
}
logMessage += `(${stringifyFilter(code)}, ${regexStr})`;
} else if (searchType === "mapMangledModule") {
const [code, mappers] = parsedArgs;
const parsedFailedMappers = Object.entries<any>(mappers)
.filter(([key]) =>
result == null ||
(result[key]?.[SYM_PROXY_INNER_GET] != null && result[key][SYM_PROXY_INNER_VALUE] == null) ||
(result[key]?.[SYM_LAZY_COMPONENT_INNER] != null && result[key][SYM_LAZY_COMPONENT_INNER]() == null)
)
.map(([key, filter]) => {
let parsedFilter: string;
if (filter.$$vencordProps != null) {
const filterName = filter.$$vencordProps[0];
parsedFilter = `${filterName}(${filter.$$vencordProps.slice(1).map((arg: any) => arg instanceof RegExp ? String(arg) : JSON.stringify(arg)).join(", ")})`;
} else {
parsedFilter = String(filter);
if (parsedFilter.length > 150) {
parsedFilter = parsedFilter.slice(0, 147) + "...";
}
}
return [key, parsedFilter];
});
logMessage += `(${stringifyFilter(code)}, {\n${parsedFailedMappers.map(([key, parsedFilter]) => `\t${key}: ${parsedFilter}`).join(",\n")}\n})`;
} else {
logMessage += `(${filterName.length ? `${filterName}(` : ""}${parsedArgs.map(stringifyFilter).join(", ")})${filterName.length ? ")" : ""}`;
} }
else logMessage += `(${args.map(arg => `"${arg}"`).join(", ")})`;
ReporterLogger.log("Webpack Find Fail:", logMessage); ReporterLogger.log("Webpack Find Fail:", logMessage);
} }
} }));
ReporterLogger.log("Finished test"); ReporterLogger.log("Finished test");
} catch (e) { } catch (e) {
@ -81,4 +204,5 @@ async function runReporter() {
} }
} }
runReporter(); // Run after the Vencord object has been created
setTimeout(runReporter, 0);

7
src/globals.d.ts vendored
View file

@ -64,13 +64,8 @@ declare global {
export var Vesktop: any; export var Vesktop: any;
export var VesktopNative: any; export var VesktopNative: any;
interface Window { interface Window extends Record<PropertyKey, any> {
webpackChunkdiscord_app: {
push(chunk: any): any;
pop(): any;
};
_: LoDashStatic; _: LoDashStatic;
[k: string]: any;
} }
} }

View file

@ -0,0 +1,3 @@
[class*="profileBadges"] {
flex: none;
}

View file

@ -16,6 +16,8 @@
* 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 "./fixBadgeOverflow.css";
import { _getBadges, BadgePosition, BadgeUserArgs, ProfileBadge } from "@api/Badges"; import { _getBadges, BadgePosition, BadgeUserArgs, ProfileBadge } from "@api/Badges";
import DonateButton from "@components/DonateButton"; import DonateButton from "@components/DonateButton";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
@ -77,7 +79,7 @@ export default definePlugin({
replace: "...$1.props,$& $1.image??" replace: "...$1.props,$& $1.image??"
}, },
{ {
match: /(?<=text:(\i)\.description,.{0,200})children:/, match: /(?<=text:(\i)\.description,.{0,50})children:/,
replace: "children:$1.component ? $self.renderBadgeComponent({ ...$1 }) :" replace: "children:$1.component ? $self.renderBadgeComponent({ ...$1 }) :"
}, },
// conditionally override their onClick with badge.onClick if it exists // conditionally override their onClick with badge.onClick if it exists

View file

@ -34,7 +34,7 @@ export default definePlugin({
{ {
find: "Messages.SERVERS,children", find: "Messages.SERVERS,children",
replacement: { replacement: {
match: /(?<=Messages\.SERVERS,children:)\i\.map\(\i\)/, match: /(?<=Messages\.SERVERS,children:).+?default:return null\}\}\)/,
replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"
} }
} }

View file

@ -20,6 +20,7 @@ import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import definePlugin, { OptionType, StartAt } from "@utils/types"; import definePlugin, { OptionType, StartAt } from "@utils/types";
import { WebpackRequire } from "webpack";
const settings = definePluginSettings({ const settings = definePluginSettings({
disableAnalytics: { disableAnalytics: {
@ -48,7 +49,7 @@ export default definePlugin({
}, },
}, },
{ {
find: ".METRICS", find: ".METRICS,",
replacement: [ replacement: [
{ {
match: /this\._intervalId=/, match: /this\._intervalId=/,
@ -81,9 +82,9 @@ export default definePlugin({
Object.defineProperty(Function.prototype, "g", { Object.defineProperty(Function.prototype, "g", {
configurable: true, configurable: true,
set(v: any) { set(this: WebpackRequire, globalObj: WebpackRequire["g"]) {
Object.defineProperty(this, "g", { Object.defineProperty(this, "g", {
value: v, value: globalObj,
configurable: true, configurable: true,
enumerable: true, enumerable: true,
writable: true writable: true
@ -92,11 +93,11 @@ export default definePlugin({
// Ensure this is most likely the Sentry WebpackInstance. // Ensure this is most likely the Sentry WebpackInstance.
// Function.g is a very generic property and is not uncommon for another WebpackInstance (or even a React component: <g></g>) to include it // Function.g is a very generic property and is not uncommon for another WebpackInstance (or even a React component: <g></g>) to include it
const { stack } = new Error(); const { stack } = new Error();
if (!(stack?.includes("discord.com") || stack?.includes("discordapp.com")) || !String(this).includes("exports:{}") || this.c != null) { if (this.c != null || !stack?.includes("http") || !String(this).includes("exports:{}")) {
return; return;
} }
const assetPath = stack?.match(/\/assets\/.+?\.js/)?.[0]; const assetPath = stack.match(/http.+?(?=:\d+?:\d+?$)/m)?.[0];
if (!assetPath) { if (!assetPath) {
return; return;
} }
@ -106,7 +107,8 @@ export default definePlugin({
srcRequest.send(); srcRequest.send();
// Final condition to see if this is the Sentry WebpackInstance // Final condition to see if this is the Sentry WebpackInstance
if (!srcRequest.responseText.includes("window.DiscordSentry=")) { // This is matching window.DiscordSentry=, but without `window` to avoid issues on some proxies
if (!srcRequest.responseText.includes(".DiscordSentry=")) {
return; return;
} }

View file

@ -16,7 +16,7 @@
* 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 { definePluginSettings } from "@api/Settings";
import BackupAndRestoreTab from "@components/VencordSettings/BackupAndRestoreTab"; import BackupAndRestoreTab from "@components/VencordSettings/BackupAndRestoreTab";
import CloudTab from "@components/VencordSettings/CloudTab"; import CloudTab from "@components/VencordSettings/CloudTab";
import PatchHelperTab from "@components/VencordSettings/PatchHelperTab"; import PatchHelperTab from "@components/VencordSettings/PatchHelperTab";
@ -33,11 +33,27 @@ import gitHash from "~git-hash";
type SectionType = "HEADER" | "DIVIDER" | "CUSTOM"; type SectionType = "HEADER" | "DIVIDER" | "CUSTOM";
type SectionTypes = Record<SectionType, SectionType>; type SectionTypes = Record<SectionType, SectionType>;
const settings = definePluginSettings({
settingsLocation: {
type: OptionType.SELECT,
description: "Where to put the Vencord settings section",
options: [
{ label: "At the very top", value: "top" },
{ label: "Above the Nitro section", value: "aboveNitro", default: true },
{ label: "Below the Nitro section", value: "belowNitro" },
{ label: "Above Activity Settings", value: "aboveActivity" },
{ label: "Below Activity Settings", value: "belowActivity" },
{ label: "At the very bottom", value: "bottom" },
]
}
});
export default definePlugin({ export default definePlugin({
name: "Settings", name: "Settings",
description: "Adds Settings UI and debug info", description: "Adds Settings UI and debug info",
authors: [Devs.Ven, Devs.Megu], authors: [Devs.Ven, Devs.Megu],
required: true, required: true,
settings,
patches: [ patches: [
{ {
@ -64,7 +80,7 @@ export default definePlugin({
replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}` replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}`
}, },
{ {
match: /({(?=.+?function (\i).{0,120}(\i)=\i\.useMemo.{0,60}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/, match: /({(?=.+?function (\i).{0,120}(\i)=\i\.useMemo.{0,30}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})` replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
} }
] ]
@ -136,12 +152,12 @@ export default definePlugin({
].filter(Boolean); ].filter(Boolean);
}, },
isRightSpot({ header, settings }: { header?: string; settings?: string[]; }) { isRightSpot({ header, settingsChilds }: { header?: string; settingsChilds?: string[]; }) {
const firstChild = settings?.[0]; const firstChild = settingsChilds?.[0];
// lowest two elements... sanity backup // lowest two elements... sanity backup
if (firstChild === "LOGOUT" || firstChild === "SOCIAL_LINKS") return true; if (firstChild === "LOGOUT" || firstChild === "SOCIAL_LINKS") return true;
const { settingsLocation } = Settings.plugins.Settings; const { settingsLocation } = settings.store;
if (settingsLocation === "bottom") return firstChild === "LOGOUT"; if (settingsLocation === "bottom") return firstChild === "LOGOUT";
if (settingsLocation === "belowActivity") return firstChild === "CHANGELOG"; if (settingsLocation === "belowActivity") return firstChild === "CHANGELOG";
@ -181,21 +197,6 @@ export default definePlugin({
}; };
}, },
options: {
settingsLocation: {
type: OptionType.SELECT,
description: "Where to put the Vencord settings section",
options: [
{ label: "At the very top", value: "top" },
{ label: "Above the Nitro section", value: "aboveNitro", default: true },
{ label: "Below the Nitro section", value: "belowNitro" },
{ label: "Above Activity Settings", value: "aboveActivity" },
{ label: "Below Activity Settings", value: "belowActivity" },
{ label: "At the very bottom", value: "bottom" },
]
},
},
get electronVersion() { get electronVersion() {
return VencordNative.native.getVersions().electron || window.armcord?.electron || null; return VencordNative.native.getVersions().electron || window.armcord?.electron || null;
}, },

View file

@ -59,7 +59,7 @@ const TrustedRolesIds = [
const AsyncFunction = async function () { }.constructor; const AsyncFunction = async function () { }.constructor;
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!; const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame");
async function forceUpdate() { async function forceUpdate() {
const outdated = await checkForUpdates(); const outdated = await checkForUpdates();

View file

@ -1,7 +0,0 @@
# AccountPanelServerProfile
Right click your account panel in the bottom left to view your profile in the current server
![](https://github.com/user-attachments/assets/3228497d-488f-479c-93d2-a32ccdb08f0f)
![](https://github.com/user-attachments/assets/6fc45363-d95f-4810-812f-2f9fb28b41b5)

View file

@ -1,134 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import { getCurrentChannel } from "@utils/discord";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
import { ContextMenuApi, Menu, useEffect, useRef } from "@webpack/common";
import { User } from "discord-types/general";
interface UserProfileProps {
popoutProps: Record<string, any>;
currentUser: User;
originalPopout: () => React.ReactNode;
}
const UserProfile = findComponentByCodeLazy("UserProfilePopoutWrapper: user cannot be undefined");
const styles = findByPropsLazy("accountProfilePopoutWrapper");
let openAlternatePopout = false;
let accountPanelRef: React.MutableRefObject<Record<PropertyKey, any> | null> = { current: null };
const AccountPanelContextMenu = ErrorBoundary.wrap(() => {
const { prioritizeServerProfile } = settings.use(["prioritizeServerProfile"]);
return (
<Menu.Menu
navId="vc-ap-server-profile"
onClose={ContextMenuApi.closeContextMenu}
>
<Menu.MenuItem
id="vc-ap-view-alternate-popout"
label={prioritizeServerProfile ? "View Account Profile" : "View Server Profile"}
disabled={getCurrentChannel()?.getGuildId() == null}
action={e => {
openAlternatePopout = true;
accountPanelRef.current?.props.onMouseDown();
accountPanelRef.current?.props.onClick(e);
}}
/>
<Menu.MenuCheckboxItem
id="vc-ap-prioritize-server-profile"
label="Prioritize Server Profile"
checked={prioritizeServerProfile}
action={() => settings.store.prioritizeServerProfile = !prioritizeServerProfile}
/>
</Menu.Menu>
);
}, { noop: true });
const settings = definePluginSettings({
prioritizeServerProfile: {
type: OptionType.BOOLEAN,
description: "Prioritize Server Profile when left clicking your account panel",
default: false
}
});
export default definePlugin({
name: "AccountPanelServerProfile",
description: "Right click your account panel in the bottom left to view your profile in the current server",
authors: [Devs.Nuckyz, Devs.relitrix],
settings,
patches: [
{
find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",
group: true,
replacement: [
{
match: /(?<=\.SIZE_32\)}\);)/,
replace: "$self.useAccountPanelRef();"
},
{
match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/,
replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},originalPopout:()=>{${originalPopout}}})`
},
{
match: /\.AVATAR,children:.+?(?=renderPopout:)/,
replace: "$&onRequestClose:$self.onPopoutClose,"
},
{
match: /(?<=.avatarWrapper,)/,
replace: "ref:$self.accountPanelRef,onContextMenu:$self.openAccountPanelContextMenu,"
}
]
}
],
get accountPanelRef() {
return accountPanelRef;
},
useAccountPanelRef() {
useEffect(() => () => {
accountPanelRef.current = null;
}, []);
return (accountPanelRef = useRef(null));
},
openAccountPanelContextMenu(event: React.UIEvent) {
ContextMenuApi.openContextMenu(event, AccountPanelContextMenu);
},
onPopoutClose() {
openAlternatePopout = false;
},
UserProfile: ErrorBoundary.wrap(({ popoutProps, currentUser, originalPopout }: UserProfileProps) => {
if (
(settings.store.prioritizeServerProfile && openAlternatePopout) ||
(!settings.store.prioritizeServerProfile && !openAlternatePopout)
) {
return originalPopout();
}
const currentChannel = getCurrentChannel();
if (currentChannel?.getGuildId() == null) {
return originalPopout();
}
return (
<div className={styles.accountProfilePopoutWrapper}>
<UserProfile {...popoutProps} userId={currentUser.id} guildId={currentChannel.getGuildId()} channelId={currentChannel.id} />
</div>
);
}, { noop: true })
});

View file

@ -1,3 +0,0 @@
# Always Expand Roles
Always expands the role list in profile popouts

View file

@ -21,12 +21,12 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack"; import { findByProps, findComponentByCode } from "@webpack";
type AnonUpload = Upload & { anonymise?: boolean; }; type AnonUpload = Upload & { anonymise?: boolean; };
const ActionBarIcon = findByCodeLazy(".actionBarIcon)"); const ActionBarIcon = findComponentByCode(".actionBarIcon)");
const UploadDraft = findByPropsLazy("popFirstFile", "update"); const UploadDraft = findByProps("popFirstFile", "update");
const enum Methods { const enum Methods {
Random, Random,

View file

@ -20,10 +20,10 @@ import { popNotice, showNotice } from "@api/Notices";
import { Link } from "@components/Link"; import { Link } from "@components/Link";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { ReporterTestable } from "@utils/types"; import definePlugin, { ReporterTestable } from "@utils/types";
import { findByCodeLazy } from "@webpack"; import { findByCode } from "@webpack";
import { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from "@webpack/common"; import { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from "@webpack/common";
const fetchApplicationsRPC = findByCodeLazy("APPLICATION_RPC(", "Client ID"); const fetchApplicationsRPC = findByCode("APPLICATION_RPC(", "Client ID");
async function lookupAsset(applicationId: string, key: string): Promise<string> { async function lookupAsset(applicationId: string, key: string): Promise<string> {
return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0]; return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];

View file

@ -17,15 +17,15 @@
*/ */
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; import { findByProps, findComponentByCode, findStore } from "@webpack";
import { useStateFromStores } from "@webpack/common"; import { useStateFromStores } from "@webpack/common";
import type { CSSProperties } from "react"; import type { CSSProperties } from "react";
import { ExpandedGuildFolderStore, settings } from "."; import { ExpandedGuildFolderStore, settings } from ".";
const ChannelRTCStore = findStoreLazy("ChannelRTCStore"); const ChannelRTCStore = findStore("ChannelRTCStore");
const Animations = findByPropsLazy("a", "animated", "useTransition"); const Animations = findByProps("a", "animated", "useTransition");
const GuildsBar = findComponentByCodeLazy('("guildsnav")'); const GuildsBar = findComponentByCode('("guildsnav")');
export default ErrorBoundary.wrap(guildsBarProps => { export default ErrorBoundary.wrap(guildsBarProps => {
const expandedFolders = useStateFromStores([ExpandedGuildFolderStore], () => ExpandedGuildFolderStore.getExpandedFolders()); const expandedFolders = useStateFromStores([ExpandedGuildFolderStore], () => ExpandedGuildFolderStore.getExpandedFolders());

View file

@ -19,7 +19,7 @@
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, findLazy, findStoreLazy } from "@webpack"; import { find, findByProps, findStore } from "@webpack";
import { FluxDispatcher, i18n, useMemo } from "@webpack/common"; import { FluxDispatcher, i18n, useMemo } from "@webpack/common";
import FolderSideBar from "./FolderSideBar"; import FolderSideBar from "./FolderSideBar";
@ -30,10 +30,10 @@ enum FolderIconDisplay {
MoreThanOneFolderExpanded MoreThanOneFolderExpanded
} }
const GuildsTree = findLazy(m => m.prototype?.moveNextTo); const GuildsTree = find(m => m.prototype?.moveNextTo);
const SortedGuildStore = findStoreLazy("SortedGuildStore"); const SortedGuildStore = findStore("SortedGuildStore");
export const ExpandedGuildFolderStore = findStoreLazy("ExpandedGuildFolderStore"); export const ExpandedGuildFolderStore = findStore("ExpandedGuildFolderStore");
const FolderUtils = findByPropsLazy("move", "toggleGuildFolderExpand"); const FolderUtils = findByProps("move", "toggleGuildFolderExpand");
let lastGuildId = null as string | null; let lastGuildId = null as string | null;
let dispatchingFoldersClose = false; let dispatchingFoldersClose = false;
@ -132,8 +132,8 @@ export default definePlugin({
}, },
// Export the isBetterFolders variable to the folders component // Export the isBetterFolders variable to the folders component
{ {
match: /switch\(\i\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,/, match: /(?<=\.Messages\.SERVERS.+?switch\((\i)\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,)/,
replace: '$&isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,' replace: 'isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'
} }
] ]
}, },

View file

@ -16,7 +16,7 @@
* 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 { definePluginSettings, Settings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { canonicalizeMatch } from "@utils/patches"; import { canonicalizeMatch } from "@utils/patches";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -31,7 +31,7 @@ const settings = definePluginSettings({
noSpellCheck: { noSpellCheck: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Disable spellcheck in notes", description: "Disable spellcheck in notes",
disabled: () => Settings.plugins.BetterNotesBox.hide, disabled: () => settings.store.hide,
default: false default: false
} }
}); });

View file

@ -10,12 +10,12 @@ import { ImageIcon } from "@components/Icons";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { getCurrentGuild, openImageModal } from "@utils/discord"; import { getCurrentGuild, openImageModal } from "@utils/discord";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { Clipboard, GuildStore, Menu, PermissionStore } from "@webpack/common"; import { Clipboard, GuildStore, Menu, PermissionStore } from "@webpack/common";
const GuildSettingsActions = findByPropsLazy("open", "selectRole", "updateGuild"); const GuildSettingsActions = findByProps("open", "selectRole", "updateGuild");
const DeveloperMode = getUserSettingLazy("appearance", "developerMode")!; const DeveloperMode = getUserSettingLazy("appearance", "developerMode");
function PencilIcon() { function PencilIcon() {
return ( return (

View file

@ -16,16 +16,32 @@
* 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 { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { Clipboard, Toasts } from "@webpack/common"; import { Clipboard, Toasts } from "@webpack/common";
const settings = definePluginSettings({
bothStyles: {
type: OptionType.BOOLEAN,
description: "Show both role dot and coloured names",
restartNeeded: true,
default: false,
},
copyRoleColorInProfilePopout: {
type: OptionType.BOOLEAN,
description: "Allow click on role dot in profile popout to copy role color",
restartNeeded: true,
default: false
}
});
export default definePlugin({ export default definePlugin({
name: "BetterRoleDot", name: "BetterRoleDot",
authors: [Devs.Ven, Devs.AutumnVN], authors: [Devs.Ven, Devs.AutumnVN],
description: description:
"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously", "Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously",
settings,
patches: [ patches: [
{ {
@ -39,7 +55,7 @@ export default definePlugin({
find: '"dot"===', find: '"dot"===',
all: true, all: true,
noWarn: true, noWarn: true,
predicate: () => Settings.plugins.BetterRoleDot.bothStyles, predicate: () => settings.store.bothStyles,
replacement: { replacement: {
match: /"(?:username|dot)"===\i(?!\.\i)/g, match: /"(?:username|dot)"===\i(?!\.\i)/g,
replace: "true", replace: "true",
@ -49,7 +65,7 @@ export default definePlugin({
{ {
find: ".ADD_ROLE_A11Y_LABEL", find: ".ADD_ROLE_A11Y_LABEL",
all: true, all: true,
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles, predicate: () => settings.store.copyRoleColorInProfilePopout && !settings.store.bothStyles,
noWarn: true, noWarn: true,
replacement: { replacement: {
match: /"dot"===\i/, match: /"dot"===\i/,
@ -59,7 +75,7 @@ export default definePlugin({
{ {
find: ".roleVerifiedIcon", find: ".roleVerifiedIcon",
all: true, all: true,
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles, predicate: () => settings.store.copyRoleColorInProfilePopout && !settings.store.bothStyles,
noWarn: true, noWarn: true,
replacement: { replacement: {
match: /"dot"===\i/, match: /"dot"===\i/,
@ -68,21 +84,6 @@ export default definePlugin({
} }
], ],
options: {
bothStyles: {
type: OptionType.BOOLEAN,
description: "Show both role dot and coloured names",
restartNeeded: true,
default: false,
},
copyRoleColorInProfilePopout: {
type: OptionType.BOOLEAN,
description: "Allow click on role dot in profile popout to copy role color",
restartNeeded: true,
default: false
}
},
copyToClipBoard(color: string) { copyToClipBoard(color: string) {
Clipboard.copy(color); Clipboard.copy(color);
Toasts.show({ Toasts.show({

View file

@ -21,20 +21,20 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, findExportedComponentLazy, findStoreLazy } from "@webpack"; import { findByProps, findExportedComponent, findStore } from "@webpack";
import { Constants, React, RestAPI, Tooltip } from "@webpack/common"; import { Constants, React, RestAPI, Tooltip } from "@webpack/common";
import { RenameButton } from "./components/RenameButton"; import { RenameButton } from "./components/RenameButton";
import { Session, SessionInfo } from "./types"; import { Session, SessionInfo } from "./types";
import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils"; import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils";
const AuthSessionsStore = findStoreLazy("AuthSessionsStore"); const AuthSessionsStore = findStore("AuthSessionsStore");
const UserSettingsModal = findByPropsLazy("saveAccountChanges", "open"); const UserSettingsModal = findByProps("saveAccountChanges", "open");
const TimestampClasses = findByPropsLazy("timestampTooltip", "blockquoteContainer"); const TimestampClasses = findByProps("timestampTooltip", "blockquoteContainer");
const SessionIconClasses = findByPropsLazy("sessionIcon"); const SessionIconClasses = findByProps("sessionIcon");
const BlobMask = findExportedComponentLazy("BlobMask"); const BlobMask = findExportedComponent("BlobMask");
const settings = definePluginSettings({ const settings = definePluginSettings({
backgroundCheck: { backgroundCheck: {

View file

@ -8,16 +8,17 @@ import { definePluginSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles"; import { classNameFactory } from "@api/Styles";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { SYM_PROXY_INNER_VALUE } from "@utils/proxyInner";
import { NoopComponent } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { waitFor } from "@webpack"; import { findByProps } from "@webpack";
import { ComponentDispatch, FocusLock, i18n, Menu, useEffect, useRef } from "@webpack/common"; import { ComponentDispatch, FocusLock, i18n, Menu, useEffect, useRef } from "@webpack/common";
import type { HTMLAttributes, ReactElement } from "react"; import type { HTMLAttributes, ReactElement } from "react";
type SettingsEntry = { section: string, label: string; }; type SettingsEntry = { section: string, label: string; };
const cl = classNameFactory(""); const cl = classNameFactory("");
let Classes: Record<string, string>; const Classes = findByProps("animating", "baseLayer", "bg", "layer", "layers");
waitFor(["animating", "baseLayer", "bg", "layer", "layers"], m => Classes = m);
const settings = definePluginSettings({ const settings = definePluginSettings({
disableFade: { disableFade: {
@ -132,7 +133,7 @@ export default definePlugin({
// try catch will only catch errors in the Layer function (hence why it's called as a plain function rather than a component), but // try catch will only catch errors in the Layer function (hence why it's called as a plain function rather than a component), but
// not in children // not in children
Layer(props: LayerProps) { Layer(props: LayerProps) {
if (!FocusLock || !ComponentDispatch || !Classes) { if (FocusLock === NoopComponent || ComponentDispatch[SYM_PROXY_INNER_VALUE] == null || Classes[SYM_PROXY_INNER_VALUE] == null) {
new Logger("BetterSettings").error("Failed to find some components"); new Logger("BetterSettings").error("Failed to find some components");
return props.children; return props.children;
} }

View file

@ -16,9 +16,9 @@
* 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 { findStoreLazy } from "@webpack"; import { findStore } from "@webpack";
import * as t from "./types/stores"; import * as t from "./types/stores";
export const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStoreLazy("ApplicationStreamPreviewStore"); export const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStore("ApplicationStreamPreviewStore");
export const ApplicationStreamingStore: t.ApplicationStreamingStore = findStoreLazy("ApplicationStreamingStore"); export const ApplicationStreamingStore: t.ApplicationStreamingStore = findStore("ApplicationStreamingStore");

View file

@ -16,7 +16,7 @@
* 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 { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -26,7 +26,7 @@ function setCss() {
style.textContent = ` style.textContent = `
.vc-nsfw-img [class^=imageWrapper] img, .vc-nsfw-img [class^=imageWrapper] img,
.vc-nsfw-img [class^=wrapperPaused] video { .vc-nsfw-img [class^=wrapperPaused] video {
filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px); filter: blur(${settings.store.blurAmount}px);
transition: filter 0.2s; transition: filter 0.2s;
} }
.vc-nsfw-img [class^=imageWrapper]:hover img, .vc-nsfw-img [class^=imageWrapper]:hover img,
@ -36,10 +36,20 @@ function setCss() {
`; `;
} }
const settings = definePluginSettings({
blurAmount: {
type: OptionType.NUMBER,
description: "Blur Amount",
default: 10,
onChange: setCss
}
});
export default definePlugin({ export default definePlugin({
name: "BlurNSFW", name: "BlurNSFW",
description: "Blur attachments in NSFW channels until hovered", description: "Blur attachments in NSFW channels until hovered",
authors: [Devs.Ven], authors: [Devs.Ven],
settings,
patches: [ patches: [
{ {
@ -51,15 +61,6 @@ export default definePlugin({
} }
], ],
options: {
blurAmount: {
type: OptionType.NUMBER,
description: "Blur Amount",
default: 10,
onChange: setCss
}
},
start() { start() {
style = document.createElement("style"); style = document.createElement("style");
style.id = "VcBlurNsfw"; style.id = "VcBlurNsfw";

View file

@ -16,7 +16,7 @@
* 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 { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { useTimer } from "@utils/react"; import { useTimer } from "@utils/react";
@ -25,7 +25,7 @@ import { React } from "@webpack/common";
function formatDuration(ms: number) { function formatDuration(ms: number) {
// here be dragons (moment fucking sucks) // here be dragons (moment fucking sucks)
const human = Settings.plugins.CallTimer.format === "human"; const human = settings.store.format === "human";
const format = (n: number) => human ? n : n.toString().padStart(2, "0"); const format = (n: number) => human ? n : n.toString().padStart(2, "0");
const unit = (s: string) => human ? s : ""; const unit = (s: string) => human ? s : "";
@ -46,15 +46,7 @@ function formatDuration(ms: number) {
return res; return res;
} }
export default definePlugin({ const settings = definePluginSettings({
name: "CallTimer",
description: "Adds a timer to vcs",
authors: [Devs.Ven],
startTime: 0,
interval: void 0 as NodeJS.Timeout | undefined,
options: {
format: { format: {
type: OptionType.SELECT, type: OptionType.SELECT,
description: "The timer format. This can be any valid moment.js format", description: "The timer format. This can be any valid moment.js format",
@ -70,7 +62,16 @@ export default definePlugin({
} }
] ]
} }
}, });
export default definePlugin({
name: "CallTimer",
description: "Adds a timer to vcs",
authors: [Devs.Ven],
settings,
startTime: 0,
interval: void 0 as NodeJS.Timeout | undefined,
patches: [{ patches: [{
find: "renderConnectionStatus(){", find: "renderConnectionStatus(){",

View file

@ -11,10 +11,10 @@ import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import definePlugin, { OptionType, StartAt } from "@utils/types"; import definePlugin, { OptionType, StartAt } from "@utils/types";
import { findByCodeLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; import { findByCode, findComponentByCode, findStore } from "@webpack";
import { Button, Forms, ThemeStore, useStateFromStores } from "@webpack/common"; import { Button, Forms, useStateFromStores } from "@webpack/common";
const ColorPicker = findComponentByCodeLazy(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)"); const ColorPicker = findComponentByCode(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
const colorPresets = [ const colorPresets = [
"#1E1514", "#172019", "#13171B", "#1C1C28", "#402D2D", "#1E1514", "#172019", "#13171B", "#1C1C28", "#402D2D",
@ -30,20 +30,21 @@ function onPickColor(color: number) {
updateColorVars(hexColor); updateColorVars(hexColor);
} }
const saveClientTheme = findByCodeLazy('type:"UNSYNCED_USER_SETTINGS_UPDATE', '"system"==='); const saveClientTheme = findByCode('type:"UNSYNCED_USER_SETTINGS_UPDATE', '"system"===');
function setTheme(theme: string) { function setTheme(theme: string) {
saveClientTheme({ theme }); saveClientTheme({ theme });
} }
const NitroThemeStore = findStoreLazy("ClientThemesBackgroundStore"); const ThemeStore = findStore("ThemeStore");
const ClientThemesBackgroundStore = findStore("ClientThemesBackgroundStore");
function ThemeSettings() { function ThemeSettings() {
const theme = useStateFromStores([ThemeStore], () => ThemeStore.theme); const theme = useStateFromStores([ThemeStore], () => ThemeStore.theme);
const isLightTheme = theme === "light"; const isLightTheme = theme === "light";
const oppositeTheme = isLightTheme ? "dark" : "light"; const oppositeTheme = isLightTheme ? "dark" : "light";
const nitroTheme = useStateFromStores([NitroThemeStore], () => NitroThemeStore.gradientPreset); const nitroTheme = useStateFromStores([ClientThemesBackgroundStore], () => ClientThemesBackgroundStore.gradientPreset);
const nitroThemeEnabled = nitroTheme !== undefined; const nitroThemeEnabled = nitroTheme !== undefined;
const selectedLuminance = relativeLuminance(settings.store.color); const selectedLuminance = relativeLuminance(settings.store.color);

View file

@ -60,6 +60,13 @@ export default definePlugin({
replace: "" replace: ""
} }
}, },
{
find: "notosans-400-normalitalic",
replacement: {
match: /,"notosans-.+?"/g,
replace: ""
}
},
{ {
find: 'console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");', find: 'console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");',
all: true, all: true,

View file

@ -19,11 +19,13 @@
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { getCurrentChannel, getCurrentGuild } from "@utils/discord"; import { getCurrentChannel, getCurrentGuild } from "@utils/discord";
import { SYM_LAZY_CACHED, SYM_LAZY_GET } from "@utils/lazy"; import { SYM_LAZY_CACHED, SYM_LAZY_GET } from "@utils/lazy";
import { SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact";
import { relaunch } from "@utils/native"; import { relaunch } from "@utils/native";
import { canonicalizeMatch, canonicalizeReplace, canonicalizeReplacement } from "@utils/patches"; import { canonicalizeMatch, canonicalizeReplace, canonicalizeReplacement } from "@utils/patches";
import { SYM_PROXY_INNER_GET, SYM_PROXY_INNER_VALUE } from "@utils/proxyInner";
import definePlugin, { PluginNative, StartAt } from "@utils/types"; import definePlugin, { PluginNative, StartAt } from "@utils/types";
import * as Webpack from "@webpack"; import * as Webpack from "@webpack";
import { extract, filters, findAll, findModuleId, search } from "@webpack"; import { cacheFindAll, cacheFindModuleId, extract, filters, searchFactories } from "@webpack";
import * as Common from "@webpack/common"; import * as Common from "@webpack/common";
import { loadLazyChunks } from "debug/loadLazyChunks"; import { loadLazyChunks } from "debug/loadLazyChunks";
import type { ComponentType } from "react"; import type { ComponentType } from "react";
@ -32,27 +34,29 @@ const DESKTOP_ONLY = (f: string) => () => {
throw new Error(`'${f}' is Discord Desktop only.`); throw new Error(`'${f}' is Discord Desktop only.`);
}; };
const define: typeof Object.defineProperty =
(obj, prop, desc) => {
if (Object.hasOwn(desc, "value"))
desc.writable = true;
return Object.defineProperty(obj, prop, { type Define = typeof Object.defineProperty;
const define: Define = (target, p, attributes) => {
if (Object.hasOwn(attributes, "value")) {
attributes.writable = true;
}
return Object.defineProperty(target, p, {
configurable: true, configurable: true,
enumerable: true, enumerable: true,
...desc ...attributes
}); });
}; };
function makeShortcuts() { function makeShortcuts() {
function newFindWrapper(filterFactory: (...props: any[]) => Webpack.FilterFn) { function newFindWrapper(filterFactory: (...props: any[]) => Webpack.FilterFn, shouldReturnFactory = false) {
const cache = new Map<string, unknown>(); const cache = new Map<string, unknown>();
return function (...filterProps: unknown[]) { return function (...filterProps: unknown[]) {
const cacheKey = String(filterProps); const cacheKey = String(filterProps);
if (cache.has(cacheKey)) return cache.get(cacheKey); if (cache.has(cacheKey)) return cache.get(cacheKey);
const matches = findAll(filterFactory(...filterProps)); const matches = cacheFindAll(filterFactory(...filterProps), shouldReturnFactory);
const result = (() => { const result = (() => {
switch (matches.length) { switch (matches.length) {
@ -60,50 +64,71 @@ function makeShortcuts() {
case 1: return matches[0]; case 1: return matches[0];
default: default:
const uniqueMatches = [...new Set(matches)]; const uniqueMatches = [...new Set(matches)];
if (uniqueMatches.length > 1) if (uniqueMatches.length > 1) {
console.warn(`Warning: This filter matches ${matches.length} modules. Make it more specific!\n`, uniqueMatches); console.warn(`Warning: This filter matches ${matches.length} modules. Make it more specific!\n`, uniqueMatches);
}
return matches[0]; return uniqueMatches[0];
} }
})(); })();
if (result && cacheKey) cache.set(cacheKey, result); if (result && cacheKey) cache.set(cacheKey, result);
return result; return result;
}; };
} }
let fakeRenderWin: WeakRef<Window> | undefined; let fakeRenderWin: WeakRef<Window> | undefined;
const find = newFindWrapper(f => f); const find = newFindWrapper(f => f);
const findByProps = newFindWrapper(filters.byProps); const findByProps = newFindWrapper(filters.byProps);
return { return {
...Object.fromEntries(Object.keys(Common).map(key => [key, { getter: () => Common[key] }])),
wp: Webpack, wp: Webpack,
wpc: { getter: () => Webpack.cache }, wpc: { getter: () => Webpack.cache },
wreq: { getter: () => Webpack.wreq }, wreq: { getter: () => Webpack.wreq },
wpsearch: search,
wpex: extract, WebpackInstances: { getter: () => Vencord.WebpackPatcher.allWebpackInstances },
wpexs: (code: string) => extract(findModuleId(code)!),
loadLazyChunks: IS_DEV ? loadLazyChunks : () => { throw new Error("loadLazyChunks is dev only."); }, loadLazyChunks: IS_DEV ? loadLazyChunks : () => { throw new Error("loadLazyChunks is dev only."); },
wpsearch: searchFactories,
wpex: extract,
wpexs: (...code: Webpack.CodeFilter) => extract(cacheFindModuleId(...code)!),
filters,
find, find,
findAll: findAll, findAll: cacheFindAll,
findByProps, findComponent: find,
findAllByProps: (...props: string[]) => findAll(filters.byProps(...props)), findAllComponents: cacheFindAll,
findByCode: newFindWrapper(filters.byCode), findExportedComponent: (...props: Webpack.PropsFilter) => findByProps(...props)[props[0]],
findAllByCode: (code: string) => findAll(filters.byCode(code)),
findComponentByCode: newFindWrapper(filters.componentByCode), findComponentByCode: newFindWrapper(filters.componentByCode),
findAllComponentsByCode: (...code: string[]) => findAll(filters.componentByCode(...code)), findAllComponentsByCode: (...code: Webpack.PropsFilter) => cacheFindAll(filters.componentByCode(...code)),
findExportedComponent: (...props: string[]) => findByProps(...props)[props[0]], findComponentByFields: newFindWrapper(filters.componentByFields),
findAllComponentsByFields: (...fields: Webpack.PropsFilter) => cacheFindAll(filters.componentByFields(...fields)),
findByProps,
findAllByProps: (...props: Webpack.PropsFilter) => cacheFindAll(filters.byProps(...props)),
findProp: (...props: Webpack.PropsFilter) => findByProps(...props)[props[0]],
findByCode: newFindWrapper(filters.byCode),
findAllByCode: (code: Webpack.CodeFilter) => cacheFindAll(filters.byCode(...code)),
findStore: newFindWrapper(filters.byStoreName), findStore: newFindWrapper(filters.byStoreName),
PluginsApi: { getter: () => Vencord.Plugins }, findByFactoryCode: newFindWrapper(filters.byFactoryCode),
findAllByFactoryCode: (...code: Webpack.CodeFilter) => cacheFindAll(filters.byFactoryCode(...code)),
findModuleFactory: newFindWrapper(filters.byFactoryCode, true),
findAllModuleFactories: (...code: Webpack.CodeFilter) => cacheFindAll(filters.byFactoryCode(...code), true),
plugins: { getter: () => Vencord.Plugins.plugins }, plugins: { getter: () => Vencord.Plugins.plugins },
PluginsApi: { getter: () => Vencord.Plugins },
Settings: { getter: () => Vencord.Settings }, Settings: { getter: () => Vencord.Settings },
Api: { getter: () => Vencord.Api }, Api: { getter: () => Vencord.Api },
Util: { getter: () => Vencord.Util }, Util: { getter: () => Vencord.Util },
reload: () => location.reload(), reload: () => location.reload(),
restart: IS_WEB ? DESKTOP_ONLY("restart") : relaunch, restart: IS_WEB ? DESKTOP_ONLY("restart") : relaunch,
canonicalizeMatch, canonicalizeMatch,
canonicalizeReplace, canonicalizeReplace,
canonicalizeReplacement, canonicalizeReplacement,
preEnable: (plugin: string) => (Vencord.Settings.plugins[plugin] ??= { enabled: true }).enabled = true,
fakeRender: (component: ComponentType, props: any) => { fakeRender: (component: ComponentType, props: any) => {
const prevWin = fakeRenderWin?.deref(); const prevWin = fakeRenderWin?.deref();
const win = prevWin?.closed === false const win = prevWin?.closed === false
@ -133,8 +158,6 @@ function makeShortcuts() {
Common.ReactDOM.render(Common.React.createElement(component, props), doc.body.appendChild(document.createElement("div"))); Common.ReactDOM.render(Common.React.createElement(component, props), doc.body.appendChild(document.createElement("div")));
}, },
preEnable: (plugin: string) => (Vencord.Settings.plugins[plugin] ??= { enabled: true }).enabled = true,
channel: { getter: () => getCurrentChannel(), preload: false }, channel: { getter: () => getCurrentChannel(), preload: false },
channelId: { getter: () => Common.SelectedChannelStore.getChannelId(), preload: false }, channelId: { getter: () => Common.SelectedChannelStore.getChannelId(), preload: false },
guild: { getter: () => getCurrentGuild(), preload: false }, guild: { getter: () => getCurrentGuild(), preload: false },
@ -143,6 +166,7 @@ function makeShortcuts() {
meId: { getter: () => Common.UserStore.getCurrentUser().id, preload: false }, meId: { getter: () => Common.UserStore.getCurrentUser().id, preload: false },
messages: { getter: () => Common.MessageStore.getMessages(Common.SelectedChannelStore.getChannelId()), preload: false }, messages: { getter: () => Common.MessageStore.getMessages(Common.SelectedChannelStore.getChannelId()), preload: false },
...Object.fromEntries(Object.keys(Common).map(key => [key, { getter: () => Common[key] }])),
Stores: { Stores: {
getter: () => Object.fromEntries( getter: () => Object.fromEntries(
Common.Flux.Store.getAll() Common.Flux.Store.getAll()
@ -157,11 +181,39 @@ function loadAndCacheShortcut(key: string, val: any, forceLoad: boolean) {
const currentVal = val.getter(); const currentVal = val.getter();
if (!currentVal || val.preload === false) return currentVal; if (!currentVal || val.preload === false) return currentVal;
const value = currentVal[SYM_LAZY_GET] function unwrapProxy(value: any) {
? forceLoad ? currentVal[SYM_LAZY_GET]() : currentVal[SYM_LAZY_CACHED] if (value[SYM_LAZY_GET]) {
: currentVal; return forceLoad ? value[SYM_LAZY_GET]() : value[SYM_LAZY_CACHED];
} else if (value[SYM_PROXY_INNER_GET]) {
return forceLoad ? value[SYM_PROXY_INNER_GET]() : value[SYM_PROXY_INNER_VALUE];
} else if (value[SYM_LAZY_COMPONENT_INNER]) {
return value[SYM_LAZY_COMPONENT_INNER]() != null ? value[SYM_LAZY_COMPONENT_INNER]() : value;
}
if (value) define(window.shortcutList, key, { value }); return value;
}
const value = unwrapProxy(currentVal);
if (value != null && typeof value === "object") {
const descriptors = Object.getOwnPropertyDescriptors(value);
for (const propKey in descriptors) {
if (value[propKey] == null) continue;
const descriptor = descriptors[propKey];
if (descriptor.writable === true || descriptor.set != null) {
const currentValue = value[propKey];
const newValue = unwrapProxy(currentValue);
if (newValue != null && currentValue !== newValue) {
value[propKey] = newValue;
}
}
}
}
if (value != null) {
define(window.shortcutList, key, { value });
}
return value; return value;
} }
@ -176,8 +228,10 @@ export default definePlugin({
const shortcuts = makeShortcuts(); const shortcuts = makeShortcuts();
window.shortcutList = {}; window.shortcutList = {};
for (const [key, val] of Object.entries(shortcuts)) { for (const key in shortcuts) {
if ("getter" in val) { const val = shortcuts[key];
if (Object.hasOwn(val, "getter")) {
define(window.shortcutList, key, { define(window.shortcutList, key, {
get: () => loadAndCacheShortcut(key, val, true) get: () => loadAndCacheShortcut(key, val, true)
}); });
@ -191,8 +245,8 @@ export default definePlugin({
} }
} }
// unproxy loaded modules // Unproxy loaded modules
Webpack.onceReady.then(() => { Webpack.onceDiscordLoaded.then(() => {
setTimeout(() => this.eagerLoad(false), 1000); setTimeout(() => this.eagerLoad(false), 1000);
if (!IS_WEB) { if (!IS_WEB) {
@ -203,13 +257,13 @@ export default definePlugin({
}, },
async eagerLoad(forceLoad: boolean) { async eagerLoad(forceLoad: boolean) {
await Webpack.onceReady; await Webpack.onceDiscordLoaded;
const shortcuts = makeShortcuts(); const shortcuts = makeShortcuts();
for (const key in shortcuts) {
const val = shortcuts[key];
for (const [key, val] of Object.entries(shortcuts)) { if (!Object.hasOwn(val, "getter") || val.preload === false) continue;
if (!Object.hasOwn(val, "getter") || (val as any).preload === false) continue;
try { try {
loadAndCacheShortcut(key, val, forceLoad); loadAndCacheShortcut(key, val, forceLoad);
} catch { } // swallow not found errors in DEV } catch { } // swallow not found errors in DEV

View file

@ -8,10 +8,10 @@ import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { copyWithToast } from "@utils/misc"; import { copyWithToast } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findProp } from "@webpack";
import { Menu } from "@webpack/common"; import { Menu } from "@webpack/common";
const { convertNameToSurrogate } = findByPropsLazy("convertNameToSurrogate"); const convertNameToSurrogate = findProp("convertNameToSurrogate");
interface Emoji { interface Emoji {
type: string; type: string;
@ -55,7 +55,7 @@ export default definePlugin({
settings, settings,
contextMenus: { contextMenus: {
"expression-picker"(children, { target }: { target: Target }) { "expression-picker"(children, { target }: { target: Target; }) {
if (target.dataset.type !== "emoji") return; if (target.dataset.type !== "emoji") return;
children.push( children.push(

View file

@ -1,5 +0,0 @@
# CopyFileContents
Adds a button to text file attachments to copy their contents.
![](https://github.com/user-attachments/assets/b1a0f6f4-106f-4953-94d9-4c5ef5810bca)

View file

@ -1,60 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./style.css";
import ErrorBoundary from "@components/ErrorBoundary";
import { CopyIcon, NoEntrySignIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import { copyWithToast } from "@utils/misc";
import definePlugin from "@utils/types";
import { Tooltip, useState } from "@webpack/common";
const CheckMarkIcon = () => {
return <svg width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"></path>
</svg>;
};
export default definePlugin({
name: "CopyFileContents",
description: "Adds a button to text file attachments to copy their contents",
authors: [Devs.Obsidian, Devs.Nuckyz],
patches: [
{
find: ".Messages.PREVIEW_BYTES_LEFT.format(",
replacement: {
match: /\.footerGap.+?url:\i,fileName:\i,fileSize:\i}\),(?<=fileContents:(\i),bytesLeft:(\i).+?)/g,
replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2}),"
}
}
],
addCopyButton: ErrorBoundary.wrap(({ fileContents, bytesLeft }: { fileContents: string, bytesLeft: number; }) => {
const [recentlyCopied, setRecentlyCopied] = useState(false);
return (
<Tooltip text={recentlyCopied ? "Copied!" : bytesLeft > 0 ? "File too large to copy" : "Copy File Contents"}>
{tooltipProps => (
<div
{...tooltipProps}
className="vc-cfc-button"
role="button"
onClick={() => {
if (!recentlyCopied && bytesLeft <= 0) {
copyWithToast(fileContents);
setRecentlyCopied(true);
setTimeout(() => setRecentlyCopied(false), 2000);
}
}}
>
{recentlyCopied ? <CheckMarkIcon /> : bytesLeft > 0 ? <NoEntrySignIcon color="var(--channel-icon)" /> : <CopyIcon />}
</div>
)}
</Tooltip>
);
}, { noop: true }),
});

View file

@ -1,8 +0,0 @@
.vc-cfc-button {
color: var(--interactive-normal);
cursor: pointer;
}
.vc-cfc-button:hover {
color: var(--interactive-hover);
}

View file

@ -23,22 +23,12 @@ import { Logger } from "@utils/Logger";
import { closeAllModals } from "@utils/modal"; import { closeAllModals } from "@utils/modal";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { maybePromptToUpdate } from "@utils/updater"; import { maybePromptToUpdate } from "@utils/updater";
import { filters, findBulk, proxyLazyWebpack } from "@webpack"; import { findByProps } from "@webpack";
import { DraftType, ExpressionPickerStore, FluxDispatcher, NavigationRouter, SelectedChannelStore } from "@webpack/common"; import { DraftType, ExpressionPickerStore, FluxDispatcher, NavigationRouter, SelectedChannelStore } from "@webpack/common";
const CrashHandlerLogger = new Logger("CrashHandler"); const CrashHandlerLogger = new Logger("CrashHandler");
const ModalStack = findByProps("pushLazy", "popAll");
const { ModalStack, DraftManager } = proxyLazyWebpack(() => { const DraftManager = findByProps("clearDraft", "saveDraft");
const [ModalStack, DraftManager] = findBulk(
filters.byProps("pushLazy", "popAll"),
filters.byProps("clearDraft", "saveDraft"),
);
return {
ModalStack,
DraftManager
};
});
const settings = definePluginSettings({ const settings = definePluginSettings({
attemptToPreventCrashes: { attemptToPreventCrashes: {

View file

@ -16,7 +16,7 @@
* 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 { definePluginSettings, Settings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { getUserSettingLazy } from "@api/UserSettings"; import { getUserSettingLazy } from "@api/UserSettings";
import { ErrorCard } from "@components/ErrorCard"; import { ErrorCard } from "@components/ErrorCard";
import { Link } from "@components/Link"; import { Link } from "@components/Link";
@ -26,13 +26,14 @@ import { Margins } from "@utils/margins";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findComponentByCodeLazy } from "@webpack"; import { findByCode, findByProps, findComponentByCode } from "@webpack";
import { ApplicationAssetUtils, Button, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from "@webpack/common"; import { ApplicationAssetUtils, Button, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from "@webpack/common";
const useProfileThemeStyle = findByCodeLazy("profileThemeStyle:", "--profile-gradient-primary-color"); const useProfileThemeStyle = findByCode("profileThemeStyle:", "--profile-gradient-primary-color");
const ActivityComponent = findComponentByCodeLazy("onOpenGameProfile"); const ActivityComponent = findComponentByCode("onOpenGameProfile");
const ActivityClassName = findByProps("activity", "buttonColor");
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!; const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame");
async function getApplicationAsset(key: string): Promise<string> { async function getApplicationAsset(key: string): Promise<string> {
if (/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(key)) return "mp:" + key.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//, ""); if (/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(key)) return "mp:" + key.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//, "");
@ -260,7 +261,7 @@ const settings = definePluginSettings({
function onChange() { function onChange() {
setRpc(true); setRpc(true);
if (Settings.plugins.CustomRPC.enabled) setRpc(); if (Vencord.Plugins.isPluginEnabled("CustomRPC")) setRpc();
} }
function isStreamLinkDisabled() { function isStreamLinkDisabled() {
@ -435,8 +436,8 @@ export default definePlugin({
<Forms.FormDivider className={Margins.top8} /> <Forms.FormDivider className={Margins.top8} />
<div style={{ width: "284px", ...profileThemeStyle, padding: 8, marginTop: 8, borderRadius: 8, background: "var(--bg-mod-faint)" }}> <div style={{ width: "284px", ...profileThemeStyle }}>
{activity[0] && <ActivityComponent activity={activity[0]} channelId={SelectedChannelStore.getChannelId()} {activity[0] && <ActivityComponent activity={activity[0]} className={ActivityClassName.activity} channelId={SelectedChannelStore.getChannelId()}
guild={GuildStore.getGuild(SelectedGuildStore.getLastSelectedGuildId())} guild={GuildStore.getGuild(SelectedGuildStore.getLastSelectedGuildId())}
application={{ id: settings.store.appID }} application={{ id: settings.store.appID }}
user={UserStore.getCurrentUser()} />} user={UserStore.getCurrentUser()} />}

View file

@ -46,7 +46,7 @@ const embedUrlRe = /https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/;
async function embedDidMount(this: Component<Props>) { async function embedDidMount(this: Component<Props>) {
try { try {
const { embed } = this.props; const { embed } = this.props;
const { replaceElements, dearrowByDefault } = settings.store; const { replaceElements } = settings.store;
if (!embed || embed.dearrow || embed.provider?.name !== "YouTube" || !embed.video?.url) return; if (!embed || embed.dearrow || embed.provider?.name !== "YouTube" || !embed.video?.url) return;
@ -63,22 +63,18 @@ async function embedDidMount(this: Component<Props>) {
if (!hasTitle && !hasThumb) return; if (!hasTitle && !hasThumb) return;
embed.dearrow = { embed.dearrow = {
enabled: dearrowByDefault enabled: true
}; };
if (hasTitle && replaceElements !== ReplaceElements.ReplaceThumbnailsOnly) { if (hasTitle && replaceElements !== ReplaceElements.ReplaceThumbnailsOnly) {
const replacementTitle = titles[0].title.replace(/(^|\s)>(\S)/g, "$1$2"); embed.dearrow.oldTitle = embed.rawTitle;
embed.rawTitle = titles[0].title.replace(/(^|\s)>(\S)/g, "$1$2");
embed.dearrow.oldTitle = dearrowByDefault ? embed.rawTitle : replacementTitle;
if (dearrowByDefault) embed.rawTitle = replacementTitle;
} }
if (hasThumb && replaceElements !== ReplaceElements.ReplaceTitlesOnly) {
const replacementProxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`;
embed.dearrow.oldThumb = dearrowByDefault ? embed.thumbnail.proxyURL : replacementProxyURL; if (hasThumb && replaceElements !== ReplaceElements.ReplaceTitlesOnly) {
if (dearrowByDefault) embed.thumbnail.proxyURL = replacementProxyURL; embed.dearrow.oldThumb = embed.thumbnail.proxyURL;
embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`;
} }
this.forceUpdate(); this.forceUpdate();
@ -100,7 +96,6 @@ function DearrowButton({ component }: { component: Component<Props>; }) {
className={"vc-dearrow-toggle-" + (embed.dearrow.enabled ? "on" : "off")} className={"vc-dearrow-toggle-" + (embed.dearrow.enabled ? "on" : "off")}
onClick={() => { onClick={() => {
const { enabled, oldThumb, oldTitle } = embed.dearrow; const { enabled, oldThumb, oldTitle } = embed.dearrow;
settings.store.dearrowByDefault = !enabled;
embed.dearrow.enabled = !enabled; embed.dearrow.enabled = !enabled;
if (oldTitle) { if (oldTitle) {
embed.dearrow.oldTitle = embed.rawTitle; embed.dearrow.oldTitle = embed.rawTitle;
@ -158,12 +153,6 @@ const settings = definePluginSettings({
{ label: "Titles", value: ReplaceElements.ReplaceTitlesOnly }, { label: "Titles", value: ReplaceElements.ReplaceTitlesOnly },
{ label: "Thumbnails", value: ReplaceElements.ReplaceThumbnailsOnly }, { label: "Thumbnails", value: ReplaceElements.ReplaceThumbnailsOnly },
], ],
},
dearrowByDefault: {
description: "Dearrow videos automatically",
type: OptionType.BOOLEAN,
default: true,
restartNeeded: false
} }
}); });

View file

@ -5,7 +5,7 @@
*/ */
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { findByCodeLazy } from "@webpack"; import { findComponentByCode } from "@webpack";
import { Button, useEffect } from "@webpack/common"; import { Button, useEffect } from "@webpack/common";
import { useAuthorizationStore } from "../../lib/stores/AuthorizationStore"; import { useAuthorizationStore } from "../../lib/stores/AuthorizationStore";
@ -13,7 +13,7 @@ import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDeco
import { cl } from "../"; import { cl } from "../";
import { openChangeDecorationModal } from "../modals/ChangeDecorationModal"; import { openChangeDecorationModal } from "../modals/ChangeDecorationModal";
const CustomizationSection = findByCodeLazy(".customizationSectionBackground"); const CustomizationSection = findComponentByCode(".customizationSectionBackground");
export interface DecorSectionProps { export interface DecorSectionProps {
hideTitle?: boolean; hideTitle?: boolean;

View file

@ -5,13 +5,13 @@
*/ */
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { React } from "@webpack/common"; import { React } from "@webpack/common";
import { cl } from "../"; import { cl } from "../";
import Grid, { GridProps } from "./Grid"; import Grid, { GridProps } from "./Grid";
const ScrollerClasses = findByPropsLazy("managedReactiveScroller"); const ScrollerClasses = findByProps("managedReactiveScroller");
type Section<SectionT, ItemT> = SectionT & { type Section<SectionT, ItemT> = SectionT & {
items: Array<ItemT>; items: Array<ItemT>;

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import { findComponentByCode, LazyComponentWebpack } from "@webpack"; import { NoopComponent } from "@utils/react";
import { findComponentByCode } from "@webpack";
import { React } from "@webpack/common"; import { React } from "@webpack/common";
import type { ComponentType, HTMLProps, PropsWithChildren } from "react"; import type { ComponentType, HTMLProps, PropsWithChildren } from "react";
@ -15,13 +16,10 @@ type DecorationGridItemComponent = ComponentType<PropsWithChildren<HTMLProps<HTM
isSelected: boolean, isSelected: boolean,
}>; }>;
export let DecorationGridItem: DecorationGridItemComponent; export let DecorationGridItem: DecorationGridItemComponent = NoopComponent;
export const setDecorationGridItem = v => DecorationGridItem = v; export const setDecorationGridItem = v => DecorationGridItem = v;
export const AvatarDecorationModalPreview = LazyComponentWebpack(() => { export const AvatarDecorationModalPreview = findComponentByCode<any>(".shopPreviewBanner", component => React.memo(component));
const component = findComponentByCode(".shopPreviewBanner");
return React.memo(component);
});
type DecorationGridDecorationComponent = React.ComponentType<HTMLProps<HTMLDivElement> & { type DecorationGridDecorationComponent = React.ComponentType<HTMLProps<HTMLDivElement> & {
avatarDecoration: AvatarDecoration; avatarDecoration: AvatarDecoration;
@ -29,5 +27,5 @@ type DecorationGridDecorationComponent = React.ComponentType<HTMLProps<HTMLDivEl
isSelected: boolean, isSelected: boolean,
}>; }>;
export let DecorationGridDecoration: DecorationGridDecorationComponent; export let DecorationGridDecoration: DecorationGridDecorationComponent = NoopComponent;
export const setDecorationGridDecoration = v => DecorationGridDecoration = v; export const setDecorationGridDecoration = v => DecorationGridDecoration = v;

View file

@ -5,10 +5,10 @@
*/ */
import { classNameFactory } from "@api/Styles"; import { classNameFactory } from "@api/Styles";
import { extractAndLoadChunksLazy, findByPropsLazy } from "@webpack"; import { extractAndLoadChunksLazy, findByProps } from "@webpack";
export const cl = classNameFactory("vc-decor-"); export const cl = classNameFactory("vc-decor-");
export const DecorationModalStyles = findByPropsLazy("modalFooterShopButton"); export const DecorationModalStyles = findByProps("modalFooterShopButton");
export const requireAvatarDecorationModal = extractAndLoadChunksLazy([".COLLECTIBLES_SHOP_FULLSCREEN&&"]); export const requireAvatarDecorationModal = extractAndLoadChunksLazy(".COLLECTIBLES_SHOP_FULLSCREEN&&");
export const requireCreateStickerModal = extractAndLoadChunksLazy(["stickerInspected]:"]); export const requireCreateStickerModal = extractAndLoadChunksLazy("stickerInspected]:");

View file

@ -10,7 +10,7 @@ import { openInviteModal } from "@utils/discord";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { classes, copyWithToast } from "@utils/misc"; import { classes, copyWithToast } from "@utils/misc";
import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { findComponentByCodeLazy } from "@webpack"; import { findComponentByCode } from "@webpack";
import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common"; import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common";
import { User } from "discord-types/general"; import { User } from "discord-types/general";
@ -29,7 +29,7 @@ import SectionedGridList from "../components/SectionedGridList";
import { openCreateDecorationModal } from "./CreateDecorationModal"; import { openCreateDecorationModal } from "./CreateDecorationModal";
import { openGuidelinesModal } from "./GuidelinesModal"; import { openGuidelinesModal } from "./GuidelinesModal";
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers"); const UserSummaryItem = findComponentByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers");
function usePresets() { function usePresets() {
const [presets, setPresets] = useState<Preset[]>([]); const [presets, setPresets] = useState<Preset[]>([]);

View file

@ -9,7 +9,7 @@ import { Link } from "@components/Link";
import { openInviteModal } from "@utils/discord"; import { openInviteModal } from "@utils/discord";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { filters, findComponentByCodeLazy, mapMangledModuleLazy } from "@webpack"; import { filters, findComponentByCode, mapMangledModule } from "@webpack";
import { Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Text, TextInput, useEffect, useMemo, UserStore, useState } from "@webpack/common"; import { Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Text, TextInput, useEffect, useMemo, UserStore, useState } from "@webpack/common";
import { GUILD_ID, INVITE_KEY, RAW_SKU_ID } from "../../lib/constants"; import { GUILD_ID, INVITE_KEY, RAW_SKU_ID } from "../../lib/constants";
@ -17,11 +17,11 @@ import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDeco
import { cl, DecorationModalStyles, requireAvatarDecorationModal, requireCreateStickerModal } from "../"; import { cl, DecorationModalStyles, requireAvatarDecorationModal, requireCreateStickerModal } from "../";
import { AvatarDecorationModalPreview } from "../components"; import { AvatarDecorationModalPreview } from "../components";
const FileUpload = findComponentByCodeLazy("fileUploadInput,"); const FileUpload = findComponentByCode("fileUploadInput,");
const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE=3]="POSITIVE', { const { HelpMessage, HelpMessageTypes } = mapMangledModule('POSITIVE=3]="POSITIVE', {
HelpMessage: filters.componentByCode(".iconDiv,", "messageType"),
HelpMessageTypes: filters.byProps("POSITIVE", "WARNING"), HelpMessageTypes: filters.byProps("POSITIVE", "WARNING"),
HelpMessage: filters.byCode(".iconDiv")
}); });
function useObjectURL(object: Blob | MediaSource | null) { function useObjectURL(object: Blob | MediaSource | null) {

View file

@ -22,7 +22,7 @@ import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches"; import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
import definePlugin, { OptionType, ReporterTestable } from "@utils/types"; import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
import { filters, findAll, search } from "@webpack"; import { cacheFindAll, filters, searchFactories } from "@webpack";
const PORT = 8485; const PORT = 8485;
const NAV_ID = "dev-companion-reconnect"; const NAV_ID = "dev-companion-reconnect";
@ -154,13 +154,13 @@ function initWs(isManual = false) {
case "testPatch": { case "testPatch": {
const { find, replacement } = data as PatchData; const { find, replacement } = data as PatchData;
const candidates = search(find); const candidates = searchFactories(find);
const keys = Object.keys(candidates); const keys = Object.keys(candidates);
if (keys.length !== 1) if (keys.length !== 1)
return reply("Expected exactly one 'find' matches, found " + keys.length); return reply("Expected exactly one 'find' matches, found " + keys.length);
const mod = candidates[keys[0]]; const mod = candidates[keys[0]];
let src = String(mod.original ?? mod).replaceAll("\n", ""); let src = String(mod).replaceAll("\n", "");
if (src.startsWith("function(")) { if (src.startsWith("function(")) {
src = "0," + src; src = "0," + src;
@ -201,22 +201,22 @@ function initWs(isManual = false) {
let results: any[]; let results: any[];
switch (type.replace("find", "").replace("Lazy", "")) { switch (type.replace("find", "").replace("Lazy", "")) {
case "": case "":
results = findAll(parsedArgs[0]); results = cacheFindAll(parsedArgs[0]);
break; break;
case "ByProps": case "ByProps":
results = findAll(filters.byProps(...parsedArgs)); results = cacheFindAll(filters.byProps(...parsedArgs));
break; break;
case "Store": case "Store":
results = findAll(filters.byStoreName(parsedArgs[0])); results = cacheFindAll(filters.byStoreName(parsedArgs[0]));
break; break;
case "ByCode": case "ByCode":
results = findAll(filters.byCode(...parsedArgs)); results = cacheFindAll(filters.byCode(...parsedArgs));
break; break;
case "ModuleId": case "ModuleId":
results = Object.keys(search(parsedArgs[0])); results = Object.keys(searchFactories(parsedArgs[0]));
break; break;
case "ComponentByCode": case "ComponentByCode":
results = findAll(filters.componentByCode(...parsedArgs)); results = cacheFindAll(filters.componentByCode(...parsedArgs));
break; break;
default: default:
return reply("Unknown Find Type " + type); return reply("Unknown Find Type " + type);

View file

@ -23,12 +23,12 @@ import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal"; import { ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { findByCodeLazy, findStoreLazy } from "@webpack"; import { findByCode, findStore } from "@webpack";
import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from "@webpack/common"; import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from "@webpack/common";
import { Promisable } from "type-fest"; import { Promisable } from "type-fest";
const StickersStore = findStoreLazy("StickersStore"); const StickersStore = findStore("StickersStore");
const uploadEmoji = findByCodeLazy(".GUILD_EMOJIS(", "EMOJI_UPLOAD_START"); const uploadEmoji = findByCode(".GUILD_EMOJIS(", "EMOJI_UPLOAD_START");
interface Sticker { interface Sticker {
t: "Sticker"; t: "Sticker";

View file

@ -23,12 +23,12 @@ import { ErrorCard } from "@components/ErrorCard";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { Forms, React } from "@webpack/common"; import { Forms, React } from "@webpack/common";
import hideBugReport from "./hideBugReport.css?managed"; import hideBugReport from "./hideBugReport.css?managed";
const KbdStyles = findByPropsLazy("key", "combo"); const KbdStyles = findByProps("key", "combo");
const settings = definePluginSettings({ const settings = definePluginSettings({
toolbarDevMenu: { toolbarDevMenu: {

View file

@ -23,36 +23,36 @@ import { ApngBlendOp, ApngDisposeOp, importApngJs } from "@utils/dependencies";
import { getCurrentGuild } from "@utils/discord"; import { getCurrentGuild } from "@utils/discord";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy, findStoreLazy, proxyLazyWebpack } from "@webpack"; import { findByCode, findByProps, findStore, webpackDependantLazy } from "@webpack";
import { Alerts, ChannelStore, DraftType, EmojiStore, FluxDispatcher, Forms, GuildMemberStore, IconUtils, lodash, Parser, PermissionsBits, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from "@webpack/common"; import { Alerts, ChannelStore, DraftType, EmojiStore, FluxDispatcher, Forms, GuildMemberStore, IconUtils, lodash, Parser, PermissionsBits, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from "@webpack/common";
import type { Emoji } from "@webpack/types"; import type { Emoji } from "@webpack/types";
import type { Message } from "discord-types/general"; import type { Message } from "discord-types/general";
import { applyPalette, GIFEncoder, quantize } from "gifenc"; import { applyPalette, GIFEncoder, quantize } from "gifenc";
import type { ReactElement, ReactNode } from "react"; import type { ReactElement, ReactNode } from "react";
const StickerStore = findStoreLazy("StickersStore") as { const StickersStore = findStore("StickersStore") as {
getPremiumPacks(): StickerPack[]; getPremiumPacks(): StickerPack[];
getAllGuildStickers(): Map<string, Sticker[]>; getAllGuildStickers(): Map<string, Sticker[]>;
getStickerById(id: string): Sticker | undefined; getStickerById(id: string): Sticker | undefined;
}; };
const UserSettingsProtoStore = findStoreLazy("UserSettingsProtoStore"); const UserSettingsProtoStore = findStore("UserSettingsProtoStore");
const BINARY_READ_OPTIONS = findByPropsLazy("readerFactory"); const BINARY_READ_OPTIONS = findByProps("readerFactory");
function searchProtoClassField(localName: string, protoClass: any) { function searchProtoClassField(localName: string, protoClass: any) {
const field = protoClass?.fields?.find((field: any) => field.localName === localName); const field = protoClass?.fields?.find((field: any) => field.localName === localName);
if (!field) return; if (!field) return;
const fieldGetter = Object.values(field).find(value => typeof value === "function") as any; const fieldGetter = Object.values<any>(field).find(value => typeof value === "function");
return fieldGetter?.(); return fieldGetter?.();
} }
const PreloadedUserSettingsActionCreators = proxyLazyWebpack(() => UserSettingsActionCreators.PreloadedUserSettingsActionCreators); const PreloadedUserSettingsActionCreators = webpackDependantLazy(() => UserSettingsActionCreators.PreloadedUserSettingsActionCreators);
const AppearanceSettingsActionCreators = proxyLazyWebpack(() => searchProtoClassField("appearance", PreloadedUserSettingsActionCreators.ProtoClass)); const AppearanceSettingsActionCreators = webpackDependantLazy(() => searchProtoClassField("appearance", PreloadedUserSettingsActionCreators.ProtoClass));
const ClientThemeSettingsActionsCreators = proxyLazyWebpack(() => searchProtoClassField("clientThemeSettings", AppearanceSettingsActionCreators)); const ClientThemeSettingsActionsCreators = webpackDependantLazy(() => searchProtoClassField("clientThemeSettings", AppearanceSettingsActionCreators));
const isUnusableRoleSubscriptionEmoji = findByCodeLazy(".getUserIsAdmin("); const isUnusableRoleSubscriptionEmoji = findByCode(".getUserIsAdmin(");
const enum EmojiIntentions { const enum EmojiIntentions {
REACTION, REACTION,
@ -566,8 +566,8 @@ export default definePlugin({
const gifMatch = child.props.href.match(fakeNitroGifStickerRegex); const gifMatch = child.props.href.match(fakeNitroGifStickerRegex);
if (gifMatch) { if (gifMatch) {
// There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickersStore contains the id of the fake sticker
if (StickerStore.getStickerById(gifMatch[1])) return null; if (StickersStore.getStickerById(gifMatch[1])) return null;
} }
} }
@ -655,7 +655,7 @@ export default definePlugin({
url = new URL(item); url = new URL(item);
} catch { } } catch { }
const stickerName = StickerStore.getStickerById(imgMatch[1])?.name ?? url?.searchParams.get("name") ?? "FakeNitroSticker"; const stickerName = StickersStore.getStickerById(imgMatch[1])?.name ?? url?.searchParams.get("name") ?? "FakeNitroSticker";
stickers.push({ stickers.push({
format_type: 1, format_type: 1,
id: imgMatch[1], id: imgMatch[1],
@ -668,9 +668,9 @@ export default definePlugin({
const gifMatch = item.match(fakeNitroGifStickerRegex); const gifMatch = item.match(fakeNitroGifStickerRegex);
if (gifMatch) { if (gifMatch) {
if (!StickerStore.getStickerById(gifMatch[1])) continue; if (!StickersStore.getStickerById(gifMatch[1])) continue;
const stickerName = StickerStore.getStickerById(gifMatch[1])?.name ?? "FakeNitroSticker"; const stickerName = StickersStore.getStickerById(gifMatch[1])?.name ?? "FakeNitroSticker";
stickers.push({ stickers.push({
format_type: 2, format_type: 2,
id: gifMatch[1], id: gifMatch[1],
@ -703,8 +703,8 @@ export default definePlugin({
const gifMatch = embed.url!.match(fakeNitroGifStickerRegex); const gifMatch = embed.url!.match(fakeNitroGifStickerRegex);
if (gifMatch) { if (gifMatch) {
// There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickersStore contains the id of the fake sticker
if (StickerStore.getStickerById(gifMatch[1])) return true; if (StickersStore.getStickerById(gifMatch[1])) return true;
} }
} }
@ -721,8 +721,8 @@ export default definePlugin({
const match = attachment.url.match(fakeNitroGifStickerRegex); const match = attachment.url.match(fakeNitroGifStickerRegex);
if (match) { if (match) {
// There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickersStore contains the id of the fake sticker
if (StickerStore.getStickerById(match[1])) return false; if (StickersStore.getStickerById(match[1])) return false;
} }
return true; return true;
@ -878,7 +878,7 @@ export default definePlugin({
if (!s.enableStickerBypass) if (!s.enableStickerBypass)
break stickerBypass; break stickerBypass;
const sticker = StickerStore.getStickerById(extra.stickers?.[0]!); const sticker = StickersStore.getStickerById(extra.stickers?.[0]!);
if (!sticker) if (!sticker)
break stickerBypass; break stickerBypass;

View file

@ -26,7 +26,7 @@ import { Margins } from "@utils/margins";
import { classes, copyWithToast } from "@utils/misc"; import { classes, copyWithToast } from "@utils/misc";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { extractAndLoadChunksLazy, findComponentByCodeLazy } from "@webpack"; import { extractAndLoadChunksLazy, findComponentByCode } from "@webpack";
import { Button, Flex, Forms, React, Text, UserProfileStore, UserStore, useState } from "@webpack/common"; import { Button, Flex, Forms, React, Text, UserProfileStore, UserStore, useState } from "@webpack/common";
import { User } from "discord-types/general"; import { User } from "discord-types/general";
import virtualMerge from "virtual-merge"; import virtualMerge from "virtual-merge";
@ -108,10 +108,10 @@ interface ProfileModalProps {
isTryItOutFlow: boolean; isTryItOutFlow: boolean;
} }
const ColorPicker = findComponentByCodeLazy<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)"); const ColorPicker = findComponentByCode<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
const ProfileModal = findComponentByCodeLazy<ProfileModalProps>("isTryItOutFlow:", "pendingThemeColors:", "pendingAvatarDecoration:", "EDIT_PROFILE_BANNER"); const ProfileModal = findComponentByCode<ProfileModalProps>("isTryItOutFlow:", "pendingThemeColors:", "pendingAvatarDecoration:", "EDIT_PROFILE_BANNER");
const requireColorPicker = extractAndLoadChunksLazy(["USER_SETTINGS_PROFILE_COLOR_DEFAULT_BUTTON.format"], /createPromise:\(\)=>\i\.\i(\("?.+?"?\)).then\(\i\.bind\(\i,"?(.+?)"?\)\)/); const requireColorPicker = extractAndLoadChunksLazy("USER_SETTINGS_PROFILE_COLOR_DEFAULT_BUTTON.format");
export default definePlugin({ export default definePlugin({
name: "FakeProfileThemes", name: "FakeProfileThemes",

View file

@ -20,7 +20,7 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { useCallback, useEffect, useRef, useState } from "@webpack/common"; import { useCallback, useEffect, useRef, useState } from "@webpack/common";
interface SearchBarComponentProps { interface SearchBarComponentProps {
@ -35,7 +35,7 @@ interface SearchBarComponentProps {
} }
type TSearchBarComponent = type TSearchBarComponent =
React.FC<SearchBarComponentProps> & { Sizes: Record<"SMALL" | "MEDIUM" | "LARGE", string>; }; React.ComponentType<SearchBarComponentProps> & { Sizes: Record<"SMALL" | "MEDIUM" | "LARGE", string>; };
interface Gif { interface Gif {
format: number; format: number;
@ -60,7 +60,7 @@ interface Instance {
} }
const containerClasses: { searchBar: string; } = findByPropsLazy("searchBar", "searchBarFullRow"); const containerClasses: { searchBar: string; } = findByProps("searchBar", "searchBarFullRow");
export const settings = definePluginSettings({ export const settings = definePluginSettings({
searchOption: { searchOption: {

View file

@ -19,9 +19,9 @@
import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands"; import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
const FriendInvites = findByPropsLazy("createFriendInvite"); const FriendInvites = findByProps("createFriendInvite");
export default definePlugin({ export default definePlugin({
name: "FriendInvites", name: "FriendInvites",

View file

@ -7,15 +7,16 @@
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { getCurrentChannel } from "@utils/discord"; import { getCurrentChannel } from "@utils/discord";
import { Logger } from "@utils/Logger";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { find, findByCode, findByProps } from "@webpack";
import { RelationshipStore, Text } from "@webpack/common"; import { Heading, RelationshipStore, Text } from "@webpack/common";
const containerWrapper = findByPropsLazy("memberSinceWrapper"); const containerWrapper = findByProps("memberSinceWrapper");
const container = findByPropsLazy("memberSince"); const container = findByProps("memberSince");
const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"'); const getCreatedAtDate = findByCode('month:"short",day:"numeric"');
const locale = findByPropsLazy("getLocale"); const locale = findByProps("getLocale");
const Section = findComponentByCodeLazy('"auto":"smooth"', ".section"); const section = find((m: any) => m.section !== void 0 && m.heading !== void 0 && Object.values(m).length === 2);
export default definePlugin({ export default definePlugin({
name: "FriendsSince", name: "FriendsSince",
@ -27,7 +28,7 @@ export default definePlugin({
find: ".PANEL}),nicknameIcons", find: ".PANEL}),nicknameIcons",
replacement: { replacement: {
match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id)}\)}\)/, match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id)}\)}\)/,
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})" replace: "$&,$self.friendsSinceNew({userId:$1,isSidebar:true})"
} }
}, },
// User Profile Modal // User Profile Modal
@ -35,19 +36,34 @@ export default definePlugin({
find: "action:\"PRESS_APP_CONNECTION\"", find: "action:\"PRESS_APP_CONNECTION\"",
replacement: { replacement: {
match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id),.{0,100}}\)}\),/,
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false})," replace: "$&,$self.friendsSinceNew({userId:$1,isSidebar:false}),"
} }
} }
], ],
FriendsSinceComponent: ErrorBoundary.wrap(({ userId, isSidebar }: { userId: string; isSidebar: boolean; }) => { getFriendSince(userId: string) {
try {
if (!RelationshipStore.isFriend(userId)) return null;
return RelationshipStore.getSince(userId);
} catch (err) {
new Logger("FriendsSince").error(err);
return null;
}
},
friendsSinceNew: ErrorBoundary.wrap(({ userId, isSidebar }: { userId: string; isSidebar: boolean; }) => {
if (!RelationshipStore.isFriend(userId)) return null; if (!RelationshipStore.isFriend(userId)) return null;
const friendsSince = RelationshipStore.getSince(userId); const friendsSince = RelationshipStore.getSince(userId);
if (!friendsSince) return null; if (!friendsSince) return null;
return ( return (
<Section heading="Friends Since"> <section className={section.section}>
<Heading variant="text-xs/semibold" style={isSidebar ? {} : { color: "var(--header-secondary)" }}>
Friends Since
</Heading>
{ {
isSidebar ? ( isSidebar ? (
<Text variant="text-sm/normal"> <Text variant="text-sm/normal">
@ -75,7 +91,8 @@ export default definePlugin({
</div> </div>
) )
} }
</Section>
</section>
); );
}, { noop: true }), }, { noop: true }),
}); });

View file

@ -22,13 +22,13 @@ import { getUserSettingLazy } from "@api/UserSettings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findComponentByCodeLazy } from "@webpack"; import { findComponentByCode } from "@webpack";
import style from "./style.css?managed"; import style from "./style.css?managed";
const Button = findComponentByCodeLazy("Button.Sizes.NONE,disabled:"); const Button = findComponentByCode("Button.Sizes.NONE,disabled:");
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!; const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame");
function makeIcon(showCurrentGame?: boolean) { function makeIcon(showCurrentGame?: boolean) {
const { oldIcon } = settings.use(["oldIcon"]); const { oldIcon } = settings.use(["oldIcon"]);

View file

@ -19,7 +19,7 @@
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findLazy } from "@webpack"; import { find } from "@webpack";
import { ContextMenuApi, FluxDispatcher, Menu, MessageActions } from "@webpack/common"; import { ContextMenuApi, FluxDispatcher, Menu, MessageActions } from "@webpack/common";
import { Channel, Message } from "discord-types/general"; import { Channel, Message } from "discord-types/general";
@ -49,7 +49,7 @@ const settings = definePluginSettings({
unholyMultiGreetEnabled?: boolean; unholyMultiGreetEnabled?: boolean;
}>(); }>();
const WELCOME_STICKERS = findLazy(m => Array.isArray(m) && m[0]?.name === "Wave"); const WELCOME_STICKERS = find(m => Array.isArray(m) && m[0]?.name === "Wave");
function greet(channel: Channel, message: Message, stickers: string[]) { function greet(channel: Channel, message: Message, stickers: string[]) {
const options = MessageActions.getSendMessageOptionsForReply({ const options = MessageActions.getSendMessageOptionsForReply({

View file

@ -1,13 +0,0 @@
# IgnoreActivities
Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings.
![](https://github.com/user-attachments/assets/f0c19060-0ecf-4f1c-8165-a5aa40143c82)
![](https://github.com/user-attachments/assets/73c3fa7a-5b90-41ee-a4d6-91fa76458b74)
![](https://github.com/user-attachments/assets/1ab3fe73-3911-48d1-8a08-e976af614b41)
The activity stays showing as a detected game even if ignored, differently from the stock Toggle Detection button from Discord:
![](https://github.com/user-attachments/assets/08ea60c3-3a31-42de-ae4c-7535fbf1b45a)

View file

@ -12,7 +12,7 @@ import { Flex } from "@components/Flex";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findStoreLazy } from "@webpack"; import { findStore } from "@webpack";
import { Button, Forms, showToast, TextInput, Toasts, Tooltip, useEffect, useState } from "webpack/common"; import { Button, Forms, showToast, TextInput, Toasts, Tooltip, useEffect, useState } from "webpack/common";
const enum ActivitiesTypes { const enum ActivitiesTypes {
@ -26,14 +26,9 @@ interface IgnoredActivity {
type: ActivitiesTypes; type: ActivitiesTypes;
} }
const enum FilterMode { const RunningGameStore = findStore("RunningGameStore");
Whitelist,
Blacklist
}
const RunningGameStore = findStoreLazy("RunningGameStore"); const ShowCurrentGame = getUserSettingLazy("status", "showCurrentGame");
const ShowCurrentGame = getUserSettingLazy("status", "showCurrentGame")!;
function ToggleIcon(activity: IgnoredActivity, tooltipText: string, path: string, fill: string) { function ToggleIcon(activity: IgnoredActivity, tooltipText: string, path: string, fill: string) {
return ( return (
@ -75,17 +70,14 @@ function handleActivityToggle(e: React.MouseEvent<HTMLButtonElement, MouseEvent>
if (ignoredActivityIndex === -1) settings.store.ignoredActivities = getIgnoredActivities().concat(activity); if (ignoredActivityIndex === -1) settings.store.ignoredActivities = getIgnoredActivities().concat(activity);
else settings.store.ignoredActivities = getIgnoredActivities().filter((_, index) => index !== ignoredActivityIndex); else settings.store.ignoredActivities = getIgnoredActivities().filter((_, index) => index !== ignoredActivityIndex);
recalculateActivities(); // Trigger activities recalculation
}
function recalculateActivities() {
ShowCurrentGame.updateSetting(old => old); ShowCurrentGame.updateSetting(old => old);
} }
function ImportCustomRPCComponent() { function ImportCustomRPCComponent() {
return ( return (
<Flex flexDirection="column"> <Flex flexDirection="column">
<Forms.FormText type={Forms.FormText.Types.DESCRIPTION}>Import the application id of the CustomRPC plugin to the filter list</Forms.FormText> <Forms.FormText type={Forms.FormText.Types.DESCRIPTION}>Import the application id of the CustomRPC plugin to the allowed list</Forms.FormText>
<div> <div>
<Button <Button
onClick={() => { onClick={() => {
@ -94,7 +86,7 @@ function ImportCustomRPCComponent() {
return showToast("CustomRPC application ID is not set.", Toasts.Type.FAILURE); return showToast("CustomRPC application ID is not set.", Toasts.Type.FAILURE);
} }
const isAlreadyAdded = idsListPushID?.(id); const isAlreadyAdded = allowedIdsPushID?.(id);
if (isAlreadyAdded) { if (isAlreadyAdded) {
showToast("CustomRPC application ID is already added.", Toasts.Type.FAILURE); showToast("CustomRPC application ID is already added.", Toasts.Type.FAILURE);
} }
@ -107,39 +99,39 @@ function ImportCustomRPCComponent() {
); );
} }
let idsListPushID: ((id: string) => boolean) | null = null; let allowedIdsPushID: ((id: string) => boolean) | null = null;
function IdsListComponent(props: { setValue: (value: string) => void; }) { function AllowedIdsComponent(props: { setValue: (value: string) => void; }) {
const [idsList, setIdsList] = useState<string>(settings.store.idsList ?? ""); const [allowedIds, setAllowedIds] = useState<string>(settings.store.allowedIds ?? "");
idsListPushID = (id: string) => { allowedIdsPushID = (id: string) => {
const currentIds = new Set(idsList.split(",").map(id => id.trim()).filter(Boolean)); const currentIds = new Set(allowedIds.split(",").map(id => id.trim()).filter(Boolean));
const isAlreadyAdded = currentIds.has(id) || (currentIds.add(id), false); const isAlreadyAdded = currentIds.has(id) || (currentIds.add(id), false);
const ids = Array.from(currentIds).join(", "); const ids = Array.from(currentIds).join(", ");
setIdsList(ids); setAllowedIds(ids);
props.setValue(ids); props.setValue(ids);
return isAlreadyAdded; return isAlreadyAdded;
}; };
useEffect(() => () => { useEffect(() => () => {
idsListPushID = null; allowedIdsPushID = null;
}, []); }, []);
function handleChange(newValue: string) { function handleChange(newValue: string) {
setIdsList(newValue); setAllowedIds(newValue);
props.setValue(newValue); props.setValue(newValue);
} }
return ( return (
<Forms.FormSection> <Forms.FormSection>
<Forms.FormTitle tag="h3">Filter List</Forms.FormTitle> <Forms.FormTitle tag="h3">Allowed List</Forms.FormTitle>
<Forms.FormText className={Margins.bottom8} type={Forms.FormText.Types.DESCRIPTION}>Comma separated list of activity IDs to filter (Useful for filtering specific RPC activities and CustomRPC</Forms.FormText> <Forms.FormText className={Margins.bottom8} type={Forms.FormText.Types.DESCRIPTION}>Comma separated list of activity IDs to allow (Useful for allowing RPC activities and CustomRPC)</Forms.FormText>
<TextInput <TextInput
type="text" type="text"
value={idsList} value={allowedIds}
onChange={handleChange} onChange={handleChange}
placeholder="235834946571337729, 343383572805058560" placeholder="235834946571337729, 343383572805058560"
/> />
@ -153,62 +145,40 @@ const settings = definePluginSettings({
description: "", description: "",
component: () => <ImportCustomRPCComponent /> component: () => <ImportCustomRPCComponent />
}, },
listMode: { allowedIds: {
type: OptionType.SELECT,
description: "Change the mode of the filter list",
options: [
{
label: "Whitelist",
value: FilterMode.Whitelist,
default: true
},
{
label: "Blacklist",
value: FilterMode.Blacklist,
}
],
onChange: recalculateActivities
},
idsList: {
type: OptionType.COMPONENT, type: OptionType.COMPONENT,
description: "", description: "",
default: "", default: "",
onChange(newValue: string) { onChange(newValue: string) {
const ids = new Set(newValue.split(",").map(id => id.trim()).filter(Boolean)); const ids = new Set(newValue.split(",").map(id => id.trim()).filter(Boolean));
settings.store.idsList = Array.from(ids).join(", "); settings.store.allowedIds = Array.from(ids).join(", ");
recalculateActivities();
}, },
component: props => <IdsListComponent setValue={props.setValue} /> component: props => <AllowedIdsComponent setValue={props.setValue} />
}, },
ignorePlaying: { ignorePlaying: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Ignore all playing activities (These are usually game and RPC activities)", description: "Ignore all playing activities (These are usually game and RPC activities)",
default: false, default: false
onChange: recalculateActivities
}, },
ignoreStreaming: { ignoreStreaming: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Ignore all streaming activities", description: "Ignore all streaming activities",
default: false, default: false
onChange: recalculateActivities
}, },
ignoreListening: { ignoreListening: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Ignore all listening activities (These are usually spotify activities)", description: "Ignore all listening activities (These are usually spotify activities)",
default: false, default: false
onChange: recalculateActivities
}, },
ignoreWatching: { ignoreWatching: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Ignore all watching activities", description: "Ignore all watching activities",
default: false, default: false
onChange: recalculateActivities
}, },
ignoreCompeting: { ignoreCompeting: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Ignore all competing activities (These are normally special game activities)", description: "Ignore all competing activities (These are normally special game activities)",
default: false, default: false
onChange: recalculateActivities
} }
}).withPrivateSettings<{ }).withPrivateSettings<{
ignoredActivities: IgnoredActivity[]; ignoredActivities: IgnoredActivity[];
@ -219,8 +189,8 @@ function getIgnoredActivities() {
} }
function isActivityTypeIgnored(type: number, id?: string) { function isActivityTypeIgnored(type: number, id?: string) {
if (id && settings.store.idsList.includes(id)) { if (id && settings.store.allowedIds.includes(id)) {
return settings.store.listMode === FilterMode.Blacklist; return false;
} }
switch (type) { switch (type) {
@ -236,8 +206,8 @@ function isActivityTypeIgnored(type: number, id?: string) {
export default definePlugin({ export default definePlugin({
name: "IgnoreActivities", name: "IgnoreActivities",
authors: [Devs.Nuckyz, Devs.Kylie], authors: [Devs.Nuckyz],
description: "Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings below", description: "Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings below.",
dependencies: ["UserSettingsAPI"], dependencies: ["UserSettingsAPI"],
settings, settings,
@ -266,7 +236,6 @@ export default definePlugin({
replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),` replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`
} }
}, },
// Discord has 2 different components for activities. Currently, the last is the one being used
{ {
find: ".activityTitleText,variant", find: ".activityTitleText,variant",
replacement: { replacement: {
@ -275,21 +244,15 @@ export default definePlugin({
}, },
}, },
{ {
find: ".promotedLabelWrapperNonBanner,children", find: ".activityCardDetails,children",
replacement: { replacement: {
match: /\.appDetailsHeaderContainer.+?children:\i.*?}\),(?<=application:(\i).+?)/, match: /\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),/,
replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),` replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),`
} }
} }
], ],
async start() { async start() {
// Migrate allowedIds
if (Settings.plugins.IgnoreActivities.allowedIds) {
settings.store.idsList = Settings.plugins.IgnoreActivities.allowedIds;
delete Settings.plugins.IgnoreActivities.allowedIds; // Remove allowedIds
}
const oldIgnoredActivitiesData = await DataStore.get<Map<IgnoredActivity["id"], IgnoredActivity>>("IgnoreActivities_ignoredActivities"); const oldIgnoredActivitiesData = await DataStore.get<Map<IgnoredActivity["id"], IgnoredActivity>>("IgnoreActivities_ignoredActivities");
if (oldIgnoredActivitiesData != null) { if (oldIgnoredActivitiesData != null) {
@ -316,7 +279,7 @@ export default definePlugin({
if (isActivityTypeIgnored(props.type, props.application_id)) return false; if (isActivityTypeIgnored(props.type, props.application_id)) return false;
if (props.application_id != null) { if (props.application_id != null) {
return !getIgnoredActivities().some(activity => activity.id === props.application_id) || (settings.store.listMode === FilterMode.Whitelist && settings.store.idsList.includes(props.application_id)); return !getIgnoredActivities().some(activity => activity.id === props.application_id) || settings.store.allowedIds.includes(props.application_id);
} else { } else {
const exePath = RunningGameStore.getRunningGames().find(game => game.name === props.name)?.exePath; const exePath = RunningGameStore.getRunningGames().find(game => game.name === props.name)?.exePath;
if (exePath) { if (exePath) {

View file

@ -19,16 +19,26 @@
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findStoreLazy } from "@webpack"; import { findStore } from "@webpack";
import { ChannelStore, Constants, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common"; import { ChannelStore, Constants, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common";
import { Settings } from "Vencord";
const UserAffinitiesStore = findStoreLazy("UserAffinitiesStore"); const UserAffinitiesStore = findStore("UserAffinitiesStore");
const settings = definePluginSettings({
sortByAffinity: {
type: OptionType.BOOLEAN,
default: true,
description: "Whether to sort implicit relationships by their affinity to you.",
restartNeeded: true
}
});
export default definePlugin({ export default definePlugin({
name: "ImplicitRelationships", name: "ImplicitRelationships",
description: "Shows your implicit relationships in the Friends tab.", description: "Shows your implicit relationships in the Friends tab.",
authors: [Devs.Dolfies], authors: [Devs.Dolfies],
settings,
patches: [ patches: [
// Counts header // Counts header
{ {
@ -75,7 +85,7 @@ export default definePlugin({
{ {
find: "getRelationshipCounts(){", find: "getRelationshipCounts(){",
replacement: { replacement: {
predicate: () => Settings.plugins.ImplicitRelationships.sortByAffinity, predicate: () => settings.store.sortByAffinity,
match: /\}\)\.sortBy\((.+?)\)\.value\(\)/, match: /\}\)\.sortBy\((.+?)\)\.value\(\)/,
replace: "}).sortBy(row => $self.wrapSort(($1), row)).value()" replace: "}).sortBy(row => $self.wrapSort(($1), row)).value()"
} }
@ -104,16 +114,6 @@ export default definePlugin({
}, },
} }
], ],
settings: definePluginSettings(
{
sortByAffinity: {
type: OptionType.BOOLEAN,
default: true,
description: "Whether to sort implicit relationships by their affinity to you.",
restartNeeded: true
},
}
),
wrapSort(comparator: Function, row: any) { wrapSort(comparator: Function, row: any) {
return row.type === 5 return row.type === 5

View file

@ -66,14 +66,14 @@ export function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string) {
patch.replacement = [patch.replacement]; patch.replacement = [patch.replacement];
} }
patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate());
if (IS_REPORTER) { if (IS_REPORTER) {
patch.replacement.forEach(r => { patch.replacement.forEach(r => {
delete r.predicate; delete r.predicate;
}); });
} }
patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate());
patches.push(patch); patches.push(patch);
} }

View file

@ -21,7 +21,7 @@ import { Link } from "@components/Link";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findStore } from "@webpack";
import { ApplicationAssetUtils, FluxDispatcher, Forms } from "@webpack/common"; import { ApplicationAssetUtils, FluxDispatcher, Forms } from "@webpack/common";
interface ActivityAssets { interface ActivityAssets {
@ -86,7 +86,7 @@ const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
const logger = new Logger("LastFMRichPresence"); const logger = new Logger("LastFMRichPresence");
const presenceStore = findByPropsLazy("getLocalPresence"); const SelfPresenceStore = findStore("SelfPresenceStore");
async function getApplicationAsset(key: string): Promise<string> { async function getApplicationAsset(key: string): Promise<string> {
return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0]; return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];
@ -275,7 +275,7 @@ export default definePlugin({
async getActivity(): Promise<Activity | null> { async getActivity(): Promise<Activity | null> {
if (settings.store.hideWithSpotify) { if (settings.store.hideWithSpotify) {
for (const activity of presenceStore.getActivities()) { for (const activity of SelfPresenceStore.getActivities()) {
if (activity.type === ActivityType.LISTENING && activity.application_id !== applicationId) { if (activity.type === ActivityType.LISTENING && activity.application_id !== applicationId) {
// there is already music status because of Spotify or richerCider (probably more) // there is already music status because of Spotify or richerCider (probably more)
return null; return null;

View file

@ -14,7 +14,7 @@ import { OnlineMemberCountStore } from "./OnlineMemberCountStore";
export function MemberCount({ isTooltip, tooltipGuildId }: { isTooltip?: true; tooltipGuildId?: string; }) { export function MemberCount({ isTooltip, tooltipGuildId }: { isTooltip?: true; tooltipGuildId?: string; }) {
const currentChannel = useStateFromStores([SelectedChannelStore], () => getCurrentChannel()); const currentChannel = useStateFromStores([SelectedChannelStore], () => getCurrentChannel());
const guildId = isTooltip ? tooltipGuildId! : currentChannel?.guild_id; const guildId = isTooltip ? tooltipGuildId! : currentChannel.guild_id;
const totalCount = useStateFromStores( const totalCount = useStateFromStores(
[GuildMemberCountStore], [GuildMemberCountStore],
@ -33,7 +33,7 @@ export function MemberCount({ isTooltip, tooltipGuildId }: { isTooltip?: true; t
const threadGroups = useStateFromStores( const threadGroups = useStateFromStores(
[ThreadMemberListStore], [ThreadMemberListStore],
() => ThreadMemberListStore.getMemberListSections(currentChannel?.id) () => ThreadMemberListStore.getMemberListSections(currentChannel.id)
); );
if (!isTooltip && (groups.length >= 1 || groups[0].id !== "unknown")) { if (!isTooltip && (groups.length >= 1 || groups[0].id !== "unknown")) {

View file

@ -15,8 +15,8 @@ export const OnlineMemberCountStore = proxyLazy(() => {
const onlineMemberMap = new Map<string, number>(); const onlineMemberMap = new Map<string, number>();
class OnlineMemberCountStore extends Flux.Store { class OnlineMemberCountStore extends Flux.Store {
getCount(guildId?: string) { getCount(guildId: string) {
return onlineMemberMap.get(guildId!); return onlineMemberMap.get(guildId);
} }
async _ensureCount(guildId: string) { async _ensureCount(guildId: string) {
@ -25,8 +25,8 @@ export const OnlineMemberCountStore = proxyLazy(() => {
await PrivateChannelsStore.preload(guildId, GuildChannelStore.getDefaultChannel(guildId).id); await PrivateChannelsStore.preload(guildId, GuildChannelStore.getDefaultChannel(guildId).id);
} }
ensureCount(guildId?: string) { ensureCount(guildId: string) {
if (!guildId || onlineMemberMap.has(guildId)) return; if (onlineMemberMap.has(guildId)) return;
preloadQueue.push(() => preloadQueue.push(() =>
this._ensureCount(guildId) this._ensureCount(guildId)

View file

@ -23,17 +23,17 @@ import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findStoreLazy } from "@webpack"; import { findStore } from "@webpack";
import { FluxStore } from "@webpack/types"; import { FluxStore } from "@webpack/types";
import { MemberCount } from "./MemberCount"; import { MemberCount } from "./MemberCount";
export const GuildMemberCountStore = findStoreLazy("GuildMemberCountStore") as FluxStore & { getMemberCount(guildId?: string): number | null; }; export const GuildMemberCountStore = findStore("GuildMemberCountStore") as FluxStore & { getMemberCount(guildId: string): number | null; };
export const ChannelMemberStore = findStoreLazy("ChannelMemberStore") as FluxStore & { export const ChannelMemberStore = findStore("ChannelMemberStore") as FluxStore & {
getProps(guildId?: string, channelId?: string): { groups: { count: number; id: string; }[]; }; getProps(guildId: string, channelId: string): { groups: { count: number; id: string; }[]; };
}; };
export const ThreadMemberListStore = findStoreLazy("ThreadMemberListStore") as FluxStore & { export const ThreadMemberListStore = findStore("ThreadMemberListStore") as FluxStore & {
getMemberListSections(channelId?: string): { [sectionId: string]: { sectionId: string; userIds: string[]; }; }; getMemberListSections(channelId: string): { [sectionId: string]: { sectionId: string; userIds: string[]; }; };
}; };

View file

@ -1,6 +1,5 @@
# MentionAvatars # MentionAvatars
Shows user avatars and role icons inside mentions Shows user avatars inside mentions
![](https://github.com/user-attachments/assets/fc76ea47-5e19-4063-a592-c57785a75cc7) ![](https://github.com/user-attachments/assets/fc76ea47-5e19-4063-a592-c57785a75cc7)
![](https://github.com/user-attachments/assets/76c4c3d9-7cde-42db-ba84-903cbb40c163)

View file

@ -10,42 +10,21 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { GuildStore, SelectedGuildStore, useState } from "@webpack/common"; import { SelectedGuildStore, useState } from "@webpack/common";
import { User } from "discord-types/general"; import { User } from "discord-types/general";
const settings = definePluginSettings({ const settings = definePluginSettings({
showAtSymbol: { showAtSymbol: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Whether the the @ symbol should be displayed on user mentions", description: "Whether the the @ symbol should be displayed",
default: true default: true
} }
}); });
function DefaultRoleIcon() {
return (
<svg
className="vc-mentionAvatars-icon vc-mentionAvatars-role-icon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M14 8.00598C14 10.211 12.206 12.006 10 12.006C7.795 12.006 6 10.211 6 8.00598C6 5.80098 7.794 4.00598 10 4.00598C12.206 4.00598 14 5.80098 14 8.00598ZM2 19.006C2 15.473 5.29 13.006 10 13.006C14.711 13.006 18 15.473 18 19.006V20.006H2V19.006Z"
/>
<path
d="M20.0001 20.006H22.0001V19.006C22.0001 16.4433 20.2697 14.4415 17.5213 13.5352C19.0621 14.9127 20.0001 16.8059 20.0001 19.006V20.006Z"
/>
<path
d="M14.8834 11.9077C16.6657 11.5044 18.0001 9.9077 18.0001 8.00598C18.0001 5.96916 16.4693 4.28218 14.4971 4.0367C15.4322 5.09511 16.0001 6.48524 16.0001 8.00598C16.0001 9.44888 15.4889 10.7742 14.6378 11.8102C14.7203 11.8418 14.8022 11.8743 14.8834 11.9077Z"
/>
</svg>
);
}
export default definePlugin({ export default definePlugin({
name: "MentionAvatars", name: "MentionAvatars",
description: "Shows user avatars and role icons inside mentions", description: "Shows user avatars inside mentions",
authors: [Devs.Ven, Devs.SerStars], authors: [Devs.Ven],
patches: [{ patches: [{
find: ".USER_MENTION)", find: ".USER_MENTION)",
@ -53,13 +32,6 @@ export default definePlugin({
match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/, match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/,
replace: "children:$self.renderUsername({username:$1,user:$2})" replace: "children:$self.renderUsername({username:$1,user:$2})"
} }
},
{
find: ".ROLE_MENTION)",
replacement: {
match: /children:\[\i&&.{0,50}\.RoleDot.{0,300},\i(?=\])/,
replace: "$&,$self.renderRoleIcon(arguments[0])"
}
}], }],
settings, settings,
@ -75,31 +47,12 @@ export default definePlugin({
onMouseEnter={() => setIsHovering(true)} onMouseEnter={() => setIsHovering(true)}
onMouseLeave={() => setIsHovering(false)} onMouseLeave={() => setIsHovering(false)}
> >
<img <img src={user.getAvatarURL(SelectedGuildStore.getGuildId(), 16, isHovering)} className="vc-mentionAvatars-avatar" />
src={user.getAvatarURL(SelectedGuildStore.getGuildId(), 16, isHovering)}
className="vc-mentionAvatars-icon"
style={{ borderRadius: "50%" }}
/>
{getUsernameString(username)} {getUsernameString(username)}
</span> </span>
); );
}, { noop: true }), }, { noop: true })
renderRoleIcon: ErrorBoundary.wrap(({ roleId, guildId }: { roleId: string, guildId: string; }) => {
// Discord uses Role Mentions for uncached users because .... idk
if (!roleId) return null;
const role = GuildStore.getRole(guildId, roleId);
if (!role?.icon) return <DefaultRoleIcon />;
return (
<img
className="vc-mentionAvatars-icon vc-mentionAvatars-role-icon"
src={`${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/role-icons/${roleId}/${role.icon}.webp?size=24&quality=lossless`}
/>
);
}),
}); });
function getUsernameString(username: string) { function getUsernameString(username: string) {

View file

@ -1,16 +1,8 @@
.vc-mentionAvatars-icon { .vc-mentionAvatars-avatar {
vertical-align: middle; vertical-align: middle;
width: 1em !important; /* insane discord sets width: 100% in channel topic */ width: 1em !important; /* insane discord sets width: 100% in channel topic */
height: 1em; height: 1em;
margin: 0 4px 0.2rem 2px; margin: 0 4px 0.2rem 2px;
border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
} }
.vc-mentionAvatars-role-icon {
margin: 0 2px 0.2rem 4px;
}
/** don't display inside the ServerInfo modal owner mention */
.vc-gp-owner .vc-mentionAvatars-icon {
display: none;
}

View file

@ -20,11 +20,11 @@ import { addClickListener, removeClickListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByProps, findStore } from "@webpack";
import { FluxDispatcher, PermissionsBits, PermissionStore, UserStore } from "@webpack/common"; import { FluxDispatcher, PermissionsBits, PermissionStore, UserStore } from "@webpack/common";
const MessageActions = findByPropsLazy("deleteMessage", "startEditMessage"); const MessageActions = findByProps("deleteMessage", "startEditMessage");
const EditStore = findByPropsLazy("isEditing", "isEditingAny"); const EditMessageStore = findStore("EditMessageStore");
let isDeletePressed = false; let isDeletePressed = false;
const keydown = (e: KeyboardEvent) => e.key === "Backspace" && (isDeletePressed = true); const keydown = (e: KeyboardEvent) => e.key === "Backspace" && (isDeletePressed = true);
@ -74,7 +74,7 @@ export default definePlugin({
if (msg.deleted === true) return; if (msg.deleted === true) return;
if (isMe) { if (isMe) {
if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id)) return; if (!settings.store.enableDoubleClickToEdit || EditMessageStore.isEditing(channel.id, msg.id)) return;
MessageActions.startEditMessage(channel.id, msg.id, msg.content); MessageActions.startEditMessage(channel.id, msg.id, msg.content);
event.preventDefault(); event.preventDefault();

View file

@ -9,7 +9,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { isNonNullish } from "@utils/guards"; import { isNonNullish } from "@utils/guards";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findExportedComponentLazy } from "@webpack"; import { findExportedComponent } from "@webpack";
import { SnowflakeUtils, Tooltip } from "@webpack/common"; import { SnowflakeUtils, Tooltip } from "@webpack/common";
import { Message } from "discord-types/general"; import { Message } from "discord-types/general";
@ -26,7 +26,7 @@ interface Diff {
} }
const DISCORD_KT_DELAY = 1471228928; const DISCORD_KT_DELAY = 1471228928;
const HiddenVisually = findExportedComponentLazy("HiddenVisually"); const HiddenVisually = findExportedComponent("HiddenVisually");
export default definePlugin({ export default definePlugin({
name: "MessageLatency", name: "MessageLatency",

View file

@ -25,7 +25,7 @@ import { Devs } from "@utils/constants.js";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { Queue } from "@utils/Queue"; import { Queue } from "@utils/Queue";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { findByProps, findComponentByCode } from "@webpack";
import { import {
Button, Button,
ChannelStore, ChannelStore,
@ -47,14 +47,14 @@ const messageCache = new Map<string, {
fetched: boolean; fetched: boolean;
}>(); }>();
const Embed = findComponentByCodeLazy(".inlineMediaEmbed"); const Embed = findComponentByCode(".inlineMediaEmbed");
const AutoModEmbed = findComponentByCodeLazy(".withFooter]:", "childrenMessageContent:"); const AutoModEmbed = findComponentByCode(".withFooter]:", "childrenMessageContent:");
const ChannelMessage = findComponentByCodeLazy("childrenExecutedCommand:", ".hideAccessories"); const ChannelMessage = findComponentByCode("childrenExecutedCommand:", ".hideAccessories");
const SearchResultClasses = findByPropsLazy("message", "searchResult"); const SearchResultClasses = findByProps("message", "searchResult");
const EmbedClasses = findByPropsLazy("embedAuthorIcon", "embedAuthor", "embedAuthor"); const EmbedClasses = findByProps("embedAuthorIcon", "embedAuthor", "embedAuthor");
const MessageDisplayCompact = getUserSettingLazy("textAndImages", "messageDisplayCompact")!; const MessageDisplayCompact = getUserSettingLazy("textAndImages", "messageDisplayCompact");
const messageLinkRegex = /(?<!<)https?:\/\/(?:\w+\.)?discord(?:app)?\.com\/channels\/(?:\d{17,20}|@me)\/(\d{17,20})\/(\d{17,20})/g; const messageLinkRegex = /(?<!<)https?:\/\/(?:\w+\.)?discord(?:app)?\.com\/channels\/(?:\d{17,20}|@me)\/(\d{17,20})\/(\d{17,20})/g;
const tenorRegex = /^https:\/\/(?:www\.)?tenor\.com\//; const tenorRegex = /^https:\/\/(?:www\.)?tenor\.com\//;
@ -215,10 +215,9 @@ function computeWidthAndHeight(width: number, height: number) {
function withEmbeddedBy(message: Message, embeddedBy: string[]) { function withEmbeddedBy(message: Message, embeddedBy: string[]) {
return new Proxy(message, { return new Proxy(message, {
get(_, prop) { get(target, prop, receiver) {
if (prop === "vencordEmbeddedBy") return embeddedBy; if (prop === "vencordEmbeddedBy") return embeddedBy;
// @ts-ignore ts so bad return Reflect.get(target, prop, receiver);
return Reflect.get(...arguments);
} }
}); });
} }

View file

@ -9,13 +9,13 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { findByPropsLazy } from "@webpack"; import { findByProps } from "@webpack";
import { TabBar, Text, Timestamp, TooltipContainer, useState } from "@webpack/common"; import { TabBar, Text, Timestamp, TooltipContainer, useState } from "@webpack/common";
import { parseEditContent } from "."; import { parseEditContent } from ".";
const CodeContainerClasses = findByPropsLazy("markup", "codeContainer"); const CodeContainerClasses = findByProps("markup", "codeContainer");
const MiscClasses = findByPropsLazy("messageContent", "markupRtl"); const MiscClasses = findByProps("messageContent", "markupRtl");
const cl = classNameFactory("vc-ml-modal-"); const cl = classNameFactory("vc-ml-modal-");

View file

@ -20,7 +20,7 @@ import "./messageLogger.css";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { updateMessage } from "@api/MessageUpdater"; import { updateMessage } from "@api/MessageUpdater";
import { Settings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { disableStyle, enableStyle } from "@api/Styles"; import { disableStyle, enableStyle } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
@ -28,7 +28,7 @@ import { proxyLazy } from "@utils/lazy";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack"; import { findByCode, findByProps } from "@webpack";
import { ChannelStore, FluxDispatcher, i18n, Menu, MessageStore, Parser, SelectedChannelStore, Timestamp, UserStore, useStateFromStores } from "@webpack/common"; import { ChannelStore, FluxDispatcher, i18n, Menu, MessageStore, Parser, SelectedChannelStore, Timestamp, UserStore, useStateFromStores } from "@webpack/common";
import { Message } from "discord-types/general"; import { Message } from "discord-types/general";
@ -42,11 +42,11 @@ interface MLMessage extends Message {
firstEditTimestamp?: Date; firstEditTimestamp?: Date;
} }
const styles = findByPropsLazy("edited", "communicationDisabled", "isSystemMessage"); const styles = findByProps("edited", "communicationDisabled", "isSystemMessage");
const getMessage = findByCodeLazy('replace(/^\\n+|\\n+$/g,"")'); const getMessage = findByCode('replace(/^\\n+|\\n+$/g,"")');
function addDeleteStyle() { function addDeleteStyle() {
if (Settings.plugins.MessageLogger.deleteStyle === "text") { if (settings.store.deleteStyle === "text") {
enableStyle(textStyle); enableStyle(textStyle);
disableStyle(overlayStyle); disableStyle(overlayStyle);
} else { } else {
@ -142,58 +142,7 @@ export function parseEditContent(content: string, message: Message) {
}); });
} }
export default definePlugin({ const settings = definePluginSettings({
name: "MessageLogger",
description: "Temporarily logs deleted and edited messages.",
authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN, Devs.Nickyux, Devs.Kyuuhachi],
dependencies: ["MessageUpdaterAPI"],
contextMenus: {
"message": patchMessageContextMenu,
"channel-context": patchChannelContextMenu,
"thread-context": patchChannelContextMenu,
"user-context": patchChannelContextMenu,
"gdm-context": patchChannelContextMenu
},
start() {
addDeleteStyle();
},
renderEdits: ErrorBoundary.wrap(({ message: { id: messageId, channel_id: channelId } }: { message: Message; }) => {
const message = useStateFromStores(
[MessageStore],
() => MessageStore.getMessage(channelId, messageId) as MLMessage,
null,
(oldMsg, newMsg) => oldMsg?.editHistory === newMsg?.editHistory
);
return Settings.plugins.MessageLogger.inlineEdits && (
<>
{message.editHistory?.map(edit => (
<div className="messagelogger-edited">
{parseEditContent(edit.content, message)}
<Timestamp
timestamp={edit.timestamp}
isEdited={true}
isInline={false}
>
<span className={styles.edited}>{" "}({i18n.Messages.MESSAGE_EDITED})</span>
</Timestamp>
</div>
))}
</>
);
}, { noop: true }),
makeEdit(newMessage: any, oldMessage: any): any {
return {
timestamp: new Date(newMessage.edited_timestamp),
content: oldMessage.content
};
},
options: {
deleteStyle: { deleteStyle: {
type: OptionType.SELECT, type: OptionType.SELECT,
description: "The style of deleted messages", description: "The style of deleted messages",
@ -249,6 +198,58 @@ export default definePlugin({
description: "Comma-separated list of guild IDs to ignore", description: "Comma-separated list of guild IDs to ignore",
default: "" default: ""
}, },
});
export default definePlugin({
name: "MessageLogger",
description: "Temporarily logs deleted and edited messages.",
authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN, Devs.Nickyux, Devs.Kyuuhachi],
dependencies: ["MessageUpdaterAPI"],
settings,
contextMenus: {
"message": patchMessageContextMenu,
"channel-context": patchChannelContextMenu,
"thread-context": patchChannelContextMenu,
"user-context": patchChannelContextMenu,
"gdm-context": patchChannelContextMenu
},
start() {
addDeleteStyle();
},
renderEdits: ErrorBoundary.wrap(({ message: { id: messageId, channel_id: channelId } }: { message: Message; }) => {
const message = useStateFromStores(
[MessageStore],
() => MessageStore.getMessage(channelId, messageId) as MLMessage,
null,
(oldMsg, newMsg) => oldMsg?.editHistory === newMsg?.editHistory
);
return settings.store.inlineEdits && (
<>
{message.editHistory?.map(edit => (
<div className="messagelogger-edited">
{parseEditContent(edit.content, message)}
<Timestamp
timestamp={edit.timestamp}
isEdited={true}
isInline={false}
>
<span className={styles.edited}>{" "}({i18n.Messages.MESSAGE_EDITED})</span>
</Timestamp>
</div>
))}
</>
);
}, { noop: true }),
makeEdit(newMessage: any, oldMessage: any): any {
return {
timestamp: new Date(newMessage.edited_timestamp),
content: oldMessage.content
};
}, },
handleDelete(cache: any, data: { ids: string[], id: string; mlDeleted?: boolean; }, isBulk: boolean) { handleDelete(cache: any, data: { ids: string[], id: string; mlDeleted?: boolean; }, isBulk: boolean) {
@ -285,7 +286,7 @@ export default definePlugin({
}, },
shouldIgnore(message: any, isEdit = false) { shouldIgnore(message: any, isEdit = false) {
const { ignoreBots, ignoreSelf, ignoreUsers, ignoreChannels, ignoreGuilds, logEdits, logDeletes } = Settings.plugins.MessageLogger; const { ignoreBots, ignoreSelf, ignoreUsers, ignoreChannels, ignoreGuilds, logEdits, logDeletes } = settings.store;
const myId = UserStore.getCurrentUser().id; const myId = UserStore.getCurrentUser().id;
return ignoreBots && message.author?.bot || return ignoreBots && message.author?.bot ||
@ -493,7 +494,7 @@ export default definePlugin({
match: /if\((\i)\.blocked\)return \i\.\i\.MESSAGE_GROUP_BLOCKED;/, match: /if\((\i)\.blocked\)return \i\.\i\.MESSAGE_GROUP_BLOCKED;/,
replace: '$&else if($1.deleted) return"MESSAGE_GROUP_DELETED";', replace: '$&else if($1.deleted) return"MESSAGE_GROUP_DELETED";',
}, },
predicate: () => Settings.plugins.MessageLogger.collapseDeleted predicate: () => settings.store.collapseDeleted
}, },
{ {
// Message group rendering // Message group rendering
@ -508,7 +509,7 @@ export default definePlugin({
replace: '$&$1.type==="MESSAGE_GROUP_DELETED"?$self.Messages.DELETED_MESSAGE_COUNT:', replace: '$&$1.type==="MESSAGE_GROUP_DELETED"?$self.Messages.DELETED_MESSAGE_COUNT:',
}, },
], ],
predicate: () => Settings.plugins.MessageLogger.collapseDeleted predicate: () => settings.store.collapseDeleted
} }
] ]
}); });

View file

@ -18,7 +18,7 @@
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands";
import * as DataStore from "@api/DataStore"; import * as DataStore from "@api/DataStore";
import { Settings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -60,7 +60,7 @@ function createTagCommand(tag: Tag) {
return { content: `/${tag.name}` }; return { content: `/${tag.name}` };
} }
if (Settings.plugins.MessageTags.clyde) sendBotMessage(ctx.channel.id, { if (settings.store.clyde) sendBotMessage(ctx.channel.id, {
content: `${EMOTE} The tag **${tag.name}** has been sent!` content: `${EMOTE} The tag **${tag.name}** has been sent!`
}); });
return { content: tag.message.replaceAll("\\n", "\n") }; return { content: tag.message.replaceAll("\\n", "\n") };
@ -69,19 +69,21 @@ function createTagCommand(tag: Tag) {
}, "CustomTags"); }, "CustomTags");
} }
const settings = definePluginSettings({
export default definePlugin({
name: "MessageTags",
description: "Allows you to save messages and to use them with a simple command.",
authors: [Devs.Luna],
options: {
clyde: { clyde: {
name: "Clyde message on send", name: "Clyde message on send",
description: "If enabled, clyde will send you an ephemeral message when a tag was used.", description: "If enabled, clyde will send you an ephemeral message when a tag was used.",
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
default: true default: true
} }
}, });
export default definePlugin({
name: "MessageTags",
description: "Allows you to save messages and to use them with a simple command.",
authors: [Devs.Luna],
settings,
dependencies: ["CommandsAPI"], dependencies: ["CommandsAPI"],
async start() { async start() {

View file

@ -19,11 +19,12 @@
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { LazyComponentType } from "@utils/lazyReact";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findLazy } from "@webpack"; import { findByCode, findComponentByCode } from "@webpack";
import { Card, ChannelStore, Forms, GuildStore, PermissionsBits, Switch, TextInput, Tooltip } from "@webpack/common"; import { Card, ChannelStore, Forms, GuildStore, PermissionsBits, Switch, TextInput, Tooltip } from "@webpack/common";
import type { Permissions, RC } from "@webpack/types"; import type { Permissions } from "@webpack/types";
import type { Channel, Guild, Message, User } from "discord-types/general"; import type { Channel, Guild, Message, User } from "discord-types/general";
interface Tag { interface Tag {
@ -59,9 +60,9 @@ const computePermissions: (options: {
overwrites?: Channel["permissionOverwrites"] | null; overwrites?: Channel["permissionOverwrites"] | null;
checkElevated?: boolean /* = true */; checkElevated?: boolean /* = true */;
excludeGuildPermissions?: boolean /* = false */; excludeGuildPermissions?: boolean /* = false */;
}) => bigint = findByCodeLazy(".getCurrentUser()", ".computeLurkerPermissionsAllowList()"); }) => bigint = findByCode(".getCurrentUser()", ".computeLurkerPermissionsAllowList()");
const Tag = findLazy(m => m.Types?.[0] === "BOT") as RC<{ type?: number, className?: string, useRemSizes?: boolean; }> & { Types: Record<string, number>; }; const Tag = findComponentByCode(".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP_OFFICIAL,") as LazyComponentType<{ type?: number, className?: string, useRemSizes?: boolean; }> & { Types: Record<string, number>; };
const isWebhook = (message: Message, user: User) => !!message?.webhookId && user.isNonUserBot(); const isWebhook = (message: Message, user: User) => !!message?.webhookId && user.isNonUserBot();

View file

@ -20,16 +20,15 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { isNonNullish } from "@utils/guards"; import { isNonNullish } from "@utils/guards";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { findByProps } from "@webpack";
import { Avatar, ChannelStore, Clickable, IconUtils, RelationshipStore, ScrollerThin, useMemo, UserStore } from "@webpack/common"; import { Avatar, ChannelStore, Clickable, IconUtils, RelationshipStore, ScrollerThin, useMemo, UserStore } from "@webpack/common";
import { Channel, User } from "discord-types/general"; import { Channel, User } from "discord-types/general";
const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel"); const SelectedChannelActionCreators = findByProps("selectPrivateChannel");
const UserUtils = findByPropsLazy("getGlobalName"); const UserUtils = findByProps("getGlobalName");
const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds"); const ProfileListClasses = findByProps("emptyIconFriends", "emptyIconGuilds");
const ExpandableList = findComponentByCodeLazy(".mutualFriendItem]"); const GuildLabelClasses = findByProps("guildNick", "guildAvatarWithoutIcon");
const GuildLabelClasses = findByPropsLazy("guildNick", "guildAvatarWithoutIcon");
function getGroupDMName(channel: Channel) { function getGroupDMName(channel: Channel) {
return channel.name || return channel.name ||
@ -51,29 +50,6 @@ function getMutualGDMCountText(user: User) {
return `${count === 0 ? "No" : count} Mutual Group${count !== 1 ? "s" : ""}`; return `${count === 0 ? "No" : count} Mutual Group${count !== 1 ? "s" : ""}`;
} }
function renderClickableGDMs(mutualDms: Channel[], onClose: () => void) {
return mutualDms.map(c => (
<Clickable
className={ProfileListClasses.listRow}
onClick={() => {
onClose();
SelectedChannelActionCreators.selectPrivateChannel(c.id);
}}
>
<Avatar
src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })}
size="SIZE_40"
className={ProfileListClasses.listAvatar}
>
</Avatar>
<div className={ProfileListClasses.listRowContent}>
<div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div>
<div className={GuildLabelClasses.guildNick}>{c.recipients.length + 1} Members</div>
</div>
</Clickable>
));
}
const IS_PATCHED = Symbol("MutualGroupDMs.Patched"); const IS_PATCHED = Symbol("MutualGroupDMs.Patched");
export default definePlugin({ export default definePlugin({
@ -94,13 +70,6 @@ export default definePlugin({
replace: "$1==='MUTUAL_GDMS'?$self.renderMutualGDMs(arguments[0]):$&" replace: "$1==='MUTUAL_GDMS'?$self.renderMutualGDMs(arguments[0]):$&"
} }
] ]
},
{
find: 'section:"MUTUAL_FRIENDS"',
replacement: {
match: /\.openUserProfileModal.+?\)}\)}\)(?<=(\(0,\i\.jsxs?\)\(\i\.\i,{className:(\i)\.divider}\)).+?)/,
replace: "$&,$self.renderDMPageList({user: arguments[0].user, Divider: $1, listStyle: $2.list})"
}
} }
], ],
@ -115,9 +84,28 @@ export default definePlugin({
}, },
renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => { renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => {
const mutualGDms = useMemo(() => getMutualGroupDms(user.id), [user.id]); const mutualDms = useMemo(() => getMutualGroupDms(user.id), [user.id]);
const entries = renderClickableGDMs(mutualGDms, onClose); const entries = mutualDms.map(c => (
<Clickable
className={ProfileListClasses.listRow}
onClick={() => {
onClose();
SelectedChannelActionCreators.selectPrivateChannel(c.id);
}}
>
<Avatar
src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })}
size="SIZE_40"
className={ProfileListClasses.listAvatar}
>
</Avatar>
<div className={ProfileListClasses.listRowContent}>
<div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div>
<div className={GuildLabelClasses.guildNick}>{c.recipients.length + 1} Members</div>
</div>
</Clickable>
));
return ( return (
<ScrollerThin <ScrollerThin
@ -136,24 +124,5 @@ export default definePlugin({
} }
</ScrollerThin> </ScrollerThin>
); );
}),
renderDMPageList: ErrorBoundary.wrap(({ user, Divider, listStyle }: { user: User, Divider: JSX.Element, listStyle: string; }) => {
const mutualGDms = getMutualGroupDms(user.id);
if (mutualGDms.length === 0) return null;
const header = getMutualGDMCountText(user);
return (
<>
{Divider}
<ExpandableList
className={listStyle}
header={header}
isLoadingHeader={false}
children={renderClickableGDMs(mutualGDms, () => { })}
/>
</>
);
}) })
}); });

View file

@ -24,18 +24,18 @@ import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { CogWheel } from "@components/Icons"; import { CogWheel } from "@components/Icons";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy, mapMangledModuleLazy } from "@webpack"; import { findByCode, findProp, mapMangledModule } from "@webpack";
import { Menu } from "@webpack/common"; import { Menu } from "@webpack/common";
import { Guild } from "discord-types/general"; import { Guild } from "discord-types/general";
const { updateGuildNotificationSettings } = findByPropsLazy("updateGuildNotificationSettings"); const updateGuildNotificationSettings = findProp("updateGuildNotificationSettings");
const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(", { const { toggleShowAllChannels } = mapMangledModule(".onboardExistingMember(", {
toggleShowAllChannels: m => { toggleShowAllChannels: m => {
const s = String(m); const s = String(m);
return s.length < 100 && !s.includes("onboardExistingMember") && !s.includes("getOptedInChannels"); return s.length < 100 && !s.includes("onboardExistingMember") && !s.includes("getOptedInChannels");
} }
}); });
const isOptInEnabledForGuild = findByCodeLazy(".COMMUNITY)||", ".isOptInEnabled("); const isOptInEnabledForGuild = findByCode(".COMMUNITY)||", ".isOptInEnabled(");
const settings = definePluginSettings({ const settings = definePluginSettings({
guild: { guild: {

View file

@ -16,19 +16,28 @@
* 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 { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { RelationshipStore } from "@webpack/common";
import { Message } from "discord-types/general"; import { Message } from "discord-types/general";
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked"); const settings = definePluginSettings({
ignoreBlockedMessages: {
description: "Completely ignores (recent) incoming messages from blocked users (locally).",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true,
},
});
export default definePlugin({ export default definePlugin({
name: "NoBlockedMessages", name: "NoBlockedMessages",
description: "Hides all blocked messages from chat completely.", description: "Hides all blocked messages from chat completely.",
authors: [Devs.rushii, Devs.Samu], authors: [Devs.rushii, Devs.Samu],
settings,
patches: [ patches: [
{ {
find: "Messages.BLOCKED_MESSAGES_HIDE", find: "Messages.BLOCKED_MESSAGES_HIDE",
@ -44,7 +53,7 @@ export default definePlugin({
'"displayName","ReadStateStore")' '"displayName","ReadStateStore")'
].map(find => ({ ].map(find => ({
find, find,
predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true, predicate: () => settings.store.ignoreBlockedMessages === true,
replacement: [ replacement: [
{ {
match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, match: /(?<=MESSAGE_CREATE:function\((\i)\){)/,

View file

@ -19,9 +19,9 @@
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findStore } from "@webpack";
const MessageRequestStore = findByPropsLazy("getMessageRequestsCount"); const MessageRequestStore = findStore("MessageRequestStore");
const settings = definePluginSettings({ const settings = definePluginSettings({
hideFriendRequestsCount: { hideFriendRequestsCount: {
@ -62,7 +62,16 @@ export default definePlugin({
replace: "return 0;" replace: "return 0;"
} }
}, },
// Message requests hook // New message requests hook
{
find: 'location:"use-message-requests-count"',
predicate: () => settings.store.hideMessageRequestsCount,
replacement: {
match: /getNonChannelAckId\(\i\.\i\.MESSAGE_REQUESTS\).+?return /,
replace: "$&0;"
}
},
// Old message requests hook
{ {
find: "getMessageRequestsCount(){", find: "getMessageRequestsCount(){",
predicate: () => settings.store.hideMessageRequestsCount, predicate: () => settings.store.hideMessageRequestsCount,

View file

@ -36,7 +36,7 @@ export default definePlugin({
} }
], ],
shouldSkip(guildId: string, emoji: any) { shouldSkip(guildId: string, emoji: any) {
if (emoji.type !== 1) { if (emoji.type !== "GUILD_EMOJI") {
return false; return false;
} }
if (settings.store.shownEmojis === "onlyUnicode") { if (settings.store.shownEmojis === "onlyUnicode") {

View file

@ -33,7 +33,7 @@ interface URLReplacementRule {
// Do not forget to add protocols to the ALLOWED_PROTOCOLS constant // Do not forget to add protocols to the ALLOWED_PROTOCOLS constant
const UrlReplacementRules: Record<string, URLReplacementRule> = { const UrlReplacementRules: Record<string, URLReplacementRule> = {
spotify: { spotify: {
match: /^https:\/\/open\.spotify\.com\/(?:intl-[a-z]{2}\/)?(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/, match: /^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,
replace: (_, type, id) => `spotify://${type}/${id}`, replace: (_, type, id) => `spotify://${type}/${id}`,
description: "Open Spotify links in the Spotify app", description: "Open Spotify links in the Spotify app",
shortlinkMatch: /^https:\/\/spotify\.link\/.+$/, shortlinkMatch: /^https:\/\/spotify\.link\/.+$/,

View file

@ -21,10 +21,8 @@ import { Flex } from "@components/Flex";
import { InfoIcon, OwnerCrownIcon } from "@components/Icons"; import { InfoIcon, OwnerCrownIcon } from "@components/Icons";
import { getUniqueUsername } from "@utils/discord"; import { getUniqueUsername } from "@utils/discord";
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { findByCodeLazy } from "@webpack"; import { Clipboard, ContextMenuApi, FluxDispatcher, GuildMemberStore, GuildStore, i18n, Menu, PermissionsBits, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from "@webpack/common";
import { Clipboard, ContextMenuApi, FluxDispatcher, GuildMemberStore, GuildStore, i18n, Menu, PermissionsBits, ScrollerThin, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from "@webpack/common"; import type { Guild } from "discord-types/general";
import { UnicodeEmoji } from "@webpack/types";
import type { Guild, Role, User } from "discord-types/general";
import { settings } from ".."; import { settings } from "..";
import { cl, getPermissionDescription, getPermissionString } from "../utils"; import { cl, getPermissionDescription, getPermissionString } from "../utils";
@ -44,15 +42,15 @@ export interface RoleOrUserPermission {
overwriteDeny?: bigint; overwriteDeny?: bigint;
} }
type GetRoleIconData = (role: Role, size: number) => { customIconSrc?: string; unicodeEmoji?: UnicodeEmoji; }; function openRolesAndUsersPermissionsModal(permissions: Array<RoleOrUserPermission>, guild: Guild, header: string) {
const getRoleIconData: GetRoleIconData = findByCodeLazy("convertSurrogateToName", "customIconSrc", "unicodeEmoji"); return openModal(modalProps => (
<RolesAndUsersPermissions
function getRoleIconSrc(role: Role) { modalProps={modalProps}
const icon = getRoleIconData(role, 20); permissions={permissions}
if (!icon) return; guild={guild}
header={header}
const { customIconSrc, unicodeEmoji } = icon; />
return customIconSrc ?? unicodeEmoji?.url; ));
} }
function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, header }: { permissions: Array<RoleOrUserPermission>; guild: Guild; modalProps: ModalProps; header: string; }) { function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, header }: { permissions: Array<RoleOrUserPermission>; guild: Guild; modalProps: ModalProps; header: string; }) {
@ -88,34 +86,31 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
size={ModalSize.LARGE} size={ModalSize.LARGE}
> >
<ModalHeader> <ModalHeader>
<Text className={cl("modal-title")} variant="heading-lg/semibold">{header} permissions:</Text> <Text className={cl("perms-title")} variant="heading-lg/semibold">{header} permissions:</Text>
<ModalCloseButton onClick={modalProps.onClose} /> <ModalCloseButton onClick={modalProps.onClose} />
</ModalHeader> </ModalHeader>
<ModalContent className={cl("modal-content")}> <ModalContent>
{!selectedItem && ( {!selectedItem && (
<div className={cl("modal-no-perms")}> <div className={cl("perms-no-perms")}>
<Text variant="heading-lg/normal">No permissions to display!</Text> <Text variant="heading-lg/normal">No permissions to display!</Text>
</div> </div>
)} )}
{selectedItem && ( {selectedItem && (
<div className={cl("modal-container")}> <div className={cl("perms-container")}>
<ScrollerThin className={cl("modal-list")} orientation="auto"> <div className={cl("perms-list")}>
{permissions.map((permission, index) => { {permissions.map((permission, index) => {
const user: User | undefined = UserStore.getUser(permission.id ?? ""); const user = UserStore.getUser(permission.id ?? "");
const role: Role | undefined = roles[permission.id ?? ""]; const role = roles[permission.id ?? ""];
const roleIconSrc = role != null ? getRoleIconSrc(role) : undefined;
return ( return (
<div <button
className={cl("modal-list-item-btn")} className={cl("perms-list-item-btn")}
onClick={() => selectItem(index)} onClick={() => selectItem(index)}
role="button"
tabIndex={0}
> >
<div <div
className={cl("modal-list-item", { "modal-list-item-active": selectedItemIndex === index })} className={cl("perms-list-item", { "perms-list-item-active": selectedItemIndex === index })}
onContextMenu={e => { onContextMenu={e => {
if (permission.type === PermissionType.Role) if (permission.type === PermissionType.Role)
ContextMenuApi.openContextMenu(e, () => ( ContextMenuApi.openContextMenu(e, () => (
@ -129,6 +124,7 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
ContextMenuApi.openContextMenu(e, () => ( ContextMenuApi.openContextMenu(e, () => (
<UserContextMenu <UserContextMenu
userId={permission.id!} userId={permission.id!}
onClose={modalProps.onClose}
/> />
)); ));
} }
@ -136,19 +132,13 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
> >
{(permission.type === PermissionType.Role || permission.type === PermissionType.Owner) && ( {(permission.type === PermissionType.Role || permission.type === PermissionType.Owner) && (
<span <span
className={cl("modal-role-circle")} className={cl("perms-role-circle")}
style={{ backgroundColor: role?.colorString ?? "var(--primary-300)" }} style={{ backgroundColor: role?.colorString ?? "var(--primary-300)" }}
/> />
)} )}
{permission.type === PermissionType.Role && roleIconSrc != null && ( {permission.type === PermissionType.User && user !== undefined && (
<img <img
className={cl("modal-role-image")} className={cl("perms-user-img")}
src={roleIconSrc}
/>
)}
{permission.type === PermissionType.User && user != null && (
<img
className={cl("modal-user-img")}
src={user.getAvatarURL(void 0, void 0, false)} src={user.getAvatarURL(void 0, void 0, false)}
/> />
)} )}
@ -157,25 +147,28 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
permission.type === PermissionType.Role permission.type === PermissionType.Role
? role?.name ?? "Unknown Role" ? role?.name ?? "Unknown Role"
: permission.type === PermissionType.User : permission.type === PermissionType.User
? (user != null && getUniqueUsername(user)) ?? "Unknown User" ? (user && getUniqueUsername(user)) ?? "Unknown User"
: ( : (
<Flex style={{ gap: "0.2em", justifyItems: "center" }}> <Flex style={{ gap: "0.2em", justifyItems: "center" }}>
@owner @owner
<OwnerCrownIcon height={18} width={18} aria-hidden="true" /> <OwnerCrownIcon
height={18}
width={18}
aria-hidden="true"
/>
</Flex> </Flex>
) )
} }
</Text> </Text>
</div> </div>
</div> </button>
); );
})} })}
</ScrollerThin> </div>
<div className={cl("modal-divider")} /> <div className={cl("perms-perms")}>
<ScrollerThin className={cl("modal-perms")} orientation="auto">
{Object.entries(PermissionsBits).map(([permissionName, bit]) => ( {Object.entries(PermissionsBits).map(([permissionName, bit]) => (
<div className={cl("modal-perms-item")}> <div className={cl("perms-perms-item")}>
<div className={cl("modal-perms-item-icon")}> <div className={cl("perms-perms-item-icon")}>
{(() => { {(() => {
const { permissions, overwriteAllow, overwriteDeny } = selectedItem; const { permissions, overwriteAllow, overwriteDeny } = selectedItem;
@ -199,7 +192,7 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
</Tooltip> </Tooltip>
</div> </div>
))} ))}
</ScrollerThin> </div>
</div> </div>
)} )}
</ModalContent> </ModalContent>
@ -215,7 +208,7 @@ function RoleContextMenu({ guild, roleId, onClose }: { guild: Guild; roleId: str
aria-label="Role Options" aria-label="Role Options"
> >
<Menu.MenuItem <Menu.MenuItem
id={cl("copy-role-id")} id="vc-copy-role-id"
label={i18n.Messages.COPY_ID_ROLE} label={i18n.Messages.COPY_ID_ROLE}
action={() => { action={() => {
Clipboard.copy(roleId); Clipboard.copy(roleId);
@ -224,13 +217,14 @@ function RoleContextMenu({ guild, roleId, onClose }: { guild: Guild; roleId: str
{(settings.store as any).unsafeViewAsRole && ( {(settings.store as any).unsafeViewAsRole && (
<Menu.MenuItem <Menu.MenuItem
id={cl("view-as-role")} id="vc-pw-view-as-role"
label={i18n.Messages.VIEW_AS_ROLE} label={i18n.Messages.VIEW_AS_ROLE}
action={() => { action={() => {
const role = GuildStore.getRole(guild.id, roleId); const role = GuildStore.getRole(guild.id, roleId);
if (!role) return; if (!role) return;
onClose(); onClose();
FluxDispatcher.dispatch({ FluxDispatcher.dispatch({
type: "IMPERSONATE_UPDATE", type: "IMPERSONATE_UPDATE",
guildId: guild.id, guildId: guild.id,
@ -241,14 +235,15 @@ function RoleContextMenu({ guild, roleId, onClose }: { guild: Guild; roleId: str
} }
} }
}); });
}} }
}
/> />
)} )}
</Menu.Menu> </Menu.Menu>
); );
} }
function UserContextMenu({ userId }: { userId: string; }) { function UserContextMenu({ userId, onClose }: { userId: string; onClose: () => void; }) {
return ( return (
<Menu.Menu <Menu.Menu
navId={cl("user-context-menu")} navId={cl("user-context-menu")}
@ -256,7 +251,7 @@ function UserContextMenu({ userId }: { userId: string; }) {
aria-label="User Options" aria-label="User Options"
> >
<Menu.MenuItem <Menu.MenuItem
id={cl("copy-user-id")} id="vc-copy-user-id"
label={i18n.Messages.COPY_ID_USER} label={i18n.Messages.COPY_ID_USER}
action={() => { action={() => {
Clipboard.copy(userId); Clipboard.copy(userId);
@ -268,13 +263,4 @@ function UserContextMenu({ userId }: { userId: string; }) {
const RolesAndUsersPermissions = ErrorBoundary.wrap(RolesAndUsersPermissionsComponent); const RolesAndUsersPermissions = ErrorBoundary.wrap(RolesAndUsersPermissionsComponent);
export default function openRolesAndUsersPermissionsModal(permissions: Array<RoleOrUserPermission>, guild: Guild, header: string) { export default openRolesAndUsersPermissionsModal;
return openModal(modalProps => (
<RolesAndUsersPermissions
modalProps={modalProps}
permissions={permissions}
guild={guild}
header={header}
/>
));
}

View file

@ -19,7 +19,7 @@
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { ExpandableHeader } from "@components/ExpandableHeader"; import { ExpandableHeader } from "@components/ExpandableHeader";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import { filters, findBulk, proxyLazyWebpack } from "@webpack"; import { findByProps } from "@webpack";
import { i18n, PermissionsBits, Text, Tooltip, useMemo, UserStore } from "@webpack/common"; import { i18n, PermissionsBits, Text, Tooltip, useMemo, UserStore } from "@webpack/common";
import type { Guild, GuildMember } from "discord-types/general"; import type { Guild, GuildMember } from "discord-types/general";
@ -29,65 +29,18 @@ import openRolesAndUsersPermissionsModal, { PermissionType, type RoleOrUserPermi
interface UserPermission { interface UserPermission {
permission: string; permission: string;
roleName: string;
roleColor: string; roleColor: string;
rolePosition: number; rolePosition: number;
} }
type UserPermissions = Array<UserPermission>; type UserPermissions = Array<UserPermission>;
const { RoleRootClasses, RoleClasses, RoleBorderClasses } = proxyLazyWebpack(() => { const RoleRootClasses = findByProps("root", "showMoreButton", "collapseButton");
const [RoleRootClasses, RoleClasses, RoleBorderClasses] = findBulk( const RoleClasses = findByProps("role", "roleCircle", "roleName");
filters.byProps("root", "expandButton", "collapseButton"), const RoleBorderClasses = findByProps("roleCircle", "dot", "dotBorderColor");
filters.byProps("role", "roleCircle", "roleName"),
filters.byProps("roleCircle", "dot", "dotBorderColor")
) as Record<string, string>[];
return { RoleRootClasses, RoleClasses, RoleBorderClasses };
});
interface FakeRoleProps extends React.HTMLAttributes<HTMLDivElement> {
text: string;
color: string;
}
function FakeRole({ text, color, ...props }: FakeRoleProps) {
return (
<div {...props} className={classes(RoleClasses.role)}>
<div className={RoleClasses.roleRemoveButton}>
<span
className={classes(RoleBorderClasses.roleCircle, RoleClasses.roleCircle)}
style={{ backgroundColor: color }}
/>
</div>
<div className={RoleClasses.roleName}>
<Text
className={RoleClasses.roleNameOverflow}
variant="text-xs/medium"
>
{text}
</Text>
</div>
</div>
);
}
interface GrantedByTooltipProps {
roleName: string;
roleColor: string;
}
function GrantedByTooltip({ roleName, roleColor }: GrantedByTooltipProps) {
return (
<>
<Text variant="text-sm/medium">Granted By</Text>
<FakeRole text={roleName} color={roleColor} />
</>
);
}
function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { guild: Guild; guildMember: GuildMember; forceOpen?: boolean; }) { function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { guild: Guild; guildMember: GuildMember; forceOpen?: boolean; }) {
const { permissionsSortOrder } = settings.use(["permissionsSortOrder"]); const stns = settings.use(["permissionsSortOrder"]);
const [rolePermissions, userPermissions] = useMemo(() => { const [rolePermissions, userPermissions] = useMemo(() => {
const userPermissions: UserPermissions = []; const userPermissions: UserPermissions = [];
@ -108,7 +61,6 @@ function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { g
const OWNER = i18n.Messages.GUILD_OWNER || "Server Owner"; const OWNER = i18n.Messages.GUILD_OWNER || "Server Owner";
userPermissions.push({ userPermissions.push({
permission: OWNER, permission: OWNER,
roleName: "Owner",
roleColor: "var(--primary-300)", roleColor: "var(--primary-300)",
rolePosition: Infinity rolePosition: Infinity
}); });
@ -117,11 +69,10 @@ function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { g
sortUserRoles(userRoles); sortUserRoles(userRoles);
for (const [permission, bit] of Object.entries(PermissionsBits)) { for (const [permission, bit] of Object.entries(PermissionsBits)) {
for (const { permissions, colorString, position, name } of userRoles) { for (const { permissions, colorString, position } of userRoles) {
if ((permissions & bit) === bit) { if ((permissions & bit) === bit) {
userPermissions.push({ userPermissions.push({
permission: getPermissionString(permission), permission: getPermissionString(permission),
roleName: name,
roleColor: colorString || "var(--primary-300)", roleColor: colorString || "var(--primary-300)",
rolePosition: position rolePosition: position
}); });
@ -134,7 +85,7 @@ function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { g
userPermissions.sort((a, b) => b.rolePosition - a.rolePosition); userPermissions.sort((a, b) => b.rolePosition - a.rolePosition);
return [rolePermissions, userPermissions]; return [rolePermissions, userPermissions];
}, [permissionsSortOrder]); }, [stns.permissionsSortOrder]);
return ( return (
<ExpandableHeader <ExpandableHeader
@ -151,41 +102,46 @@ function UserPermissionsComponent({ guild, guildMember, forceOpen = false }: { g
onDropDownClick={state => settings.store.defaultPermissionsDropdownState = !state} onDropDownClick={state => settings.store.defaultPermissionsDropdownState = !state}
defaultState={settings.store.defaultPermissionsDropdownState} defaultState={settings.store.defaultPermissionsDropdownState}
buttons={[ buttons={[
<Tooltip text={`Sorting by ${permissionsSortOrder === PermissionsSortOrder.HighestRole ? "Highest Role" : "Lowest Role"}`}> (<Tooltip text={`Sorting by ${stns.permissionsSortOrder === PermissionsSortOrder.HighestRole ? "Highest Role" : "Lowest Role"}`}>
{tooltipProps => ( {tooltipProps => (
<div <button
{...tooltipProps} {...tooltipProps}
className={cl("user-sortorder-btn")} className={cl("userperms-sortorder-btn")}
role="button"
tabIndex={0}
onClick={() => { onClick={() => {
settings.store.permissionsSortOrder = permissionsSortOrder === PermissionsSortOrder.HighestRole ? PermissionsSortOrder.LowestRole : PermissionsSortOrder.HighestRole; stns.permissionsSortOrder = stns.permissionsSortOrder === PermissionsSortOrder.HighestRole ? PermissionsSortOrder.LowestRole : PermissionsSortOrder.HighestRole;
}} }}
> >
<svg <svg
width="20" width="20"
height="20" height="20"
viewBox="0 96 960 960" viewBox="0 96 960 960"
transform={permissionsSortOrder === PermissionsSortOrder.HighestRole ? "scale(1 1)" : "scale(1 -1)"} transform={stns.permissionsSortOrder === PermissionsSortOrder.HighestRole ? "scale(1 1)" : "scale(1 -1)"}
> >
<path fill="var(--text-normal)" d="M440 896V409L216 633l-56-57 320-320 320 320-56 57-224-224v487h-80Z" /> <path fill="var(--text-normal)" d="M440 896V409L216 633l-56-57 320-320 320 320-56 57-224-224v487h-80Z" />
</svg> </svg>
</div> </button>
)} )}
</Tooltip> </Tooltip>)
]}> ]}>
{userPermissions.length > 0 && ( {userPermissions.length > 0 && (
<div className={classes(RoleRootClasses.root)}> <div className={classes(RoleRootClasses.root)}>
{userPermissions.map(({ permission, roleColor, roleName }) => ( {userPermissions.map(({ permission, roleColor }) => (
<Tooltip <div className={classes(RoleClasses.role)}>
text={<GrantedByTooltip roleName={roleName} roleColor={roleColor} />} <div className={RoleClasses.roleRemoveButton}>
tooltipClassName={cl("granted-by-container")} <span
tooltipContentClassName={cl("granted-by-content")} className={classes(RoleBorderClasses.roleCircle, RoleClasses.roleCircle)}
style={{ backgroundColor: roleColor }}
/>
</div>
<div className={RoleClasses.roleName}>
<Text
className={RoleClasses.roleNameOverflow}
variant="text-xs/medium"
> >
{tooltipProps => ( {permission}
<FakeRole {...tooltipProps} text={permission} color={roleColor} /> </Text>
)} </div>
</Tooltip> </div>
))} ))}
</div> </div>
)} )}

Some files were not shown because too many files have changed in this diff Show more