feature(plugins): add dashless and always-trust from Lumi#15
feature(plugins): add dashless and always-trust from Lumi#15C0C0B01 wants to merge 6 commits intoamsryq:mainfrom
Conversation
amsryq
left a comment
There was a problem hiding this comment.
Thank you for the PR.
I might not accept Dashless plugin due to its patching approach (refer to the comments). If you don't feel like reworking on it, you can exclude this plugin from this PR and only leave AlwaysTrust
Please test your PR and run the linter if possible
| @@ -0,0 +1,19 @@ | |||
| import { Dev } from "@data/constants"; | |||
| export default definePlugin({ | ||
| name: "Always Trust", | ||
| description: "Prevents Discord's trust website confirmations", | ||
| authors: [Dev.cocobo1], |
There was a problem hiding this comment.
cocobo1 is not defined in in Devs
| import { byStoreName } from "@metro/common/stores"; | ||
|
|
||
| export default definePlugin({ | ||
| name: "Always Trust", |
There was a problem hiding this comment.
Wintry's plugin name must be PascalCase
| { | ||
| "name": "Awesomegamergame", | ||
| "id": 504401951623086081n | ||
| }], |
There was a problem hiding this comment.
This person is not a direct contributor to Wintry. Please credit them only at the codebase level.
If you're submitting this plugin on their behalf (they are the original author and intend to contribute to Wintry), include their identity in the Devs constant. Also, remove your name if you had no part in its development.
| unpatchRender = after(View, "render", (_, res) => { | ||
| return traverseAndModify(res); | ||
| }); |
There was a problem hiding this comment.
Is there no better approach than patching the View? This introduces performance overhead (especially for a simple plugin) and should be avoided
| return node; | ||
| }; | ||
|
|
||
| let unpatchRender: () => void; |
There was a problem hiding this comment.
Wintry provides a scoped patcher. Use it instead to ensure automatic unpatching during the plugin cleanup cycle:
import { patcher } from "#plugin-context";|
|
||
| const { View } = ReactNative; | ||
|
|
||
| const traverseAndModify = (node: any): any => { |
There was a problem hiding this comment.
Wouldn't this replace every string node instead of only "changing dashes in text channel names to spaces"?
|
oh yeah i just realised I need to change a few things from lumi to make it work 😅. I kinda just rushed this pr and slammed the plugins into it, ill review your changes and fix them later today |
This adds some plugins from lumi to wintry