aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/_api
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-10-06 04:00:09 +0200
committerVendicated <vendicated@riseup.net>2023-10-06 04:00:09 +0200
commit5eb9dd04dff212686e3395752877ddf62c1f78e2 (patch)
tree84434118769736f7088d6e41c119acc03aea930e /src/plugins/_api
parent03b5dc9c27250be09ae1a8c80842edf8cde642d9 (diff)
downloadVencord-5eb9dd04dff212686e3395752877ddf62c1f78e2.tar.gz
Vencord-5eb9dd04dff212686e3395752877ddf62c1f78e2.tar.bz2
Vencord-5eb9dd04dff212686e3395752877ddf62c1f78e2.zip
Fix member list decorations api
Diffstat (limited to 'src/plugins/_api')
-rw-r--r--src/plugins/_api/memberListDecorators.ts21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/_api/memberListDecorators.ts b/src/plugins/_api/memberListDecorators.ts
index 6b8cffa..a6d4125 100644
--- a/src/plugins/_api/memberListDecorators.ts
+++ b/src/plugins/_api/memberListDecorators.ts
@@ -22,21 +22,28 @@ import definePlugin from "@utils/types";
export default definePlugin({
name: "MemberListDecoratorsAPI",
description: "API to add decorators to member list (both in servers and DMs)",
- authors: [Devs.TheSun],
+ authors: [Devs.TheSun, Devs.Ven],
patches: [
{
find: "lostPermissionTooltipText,",
replacement: {
- match: /Fragment,{children:\[(.{30,80})\]/,
- replace: "Fragment,{children:Vencord.Api.MemberListDecorators.__addDecoratorsToList(this.props).concat($1)"
+ match: /decorators:.{0,100}?children:\[(?<=(\i)\.lostPermissionTooltipText.+?)/,
+ replace: "$&...Vencord.Api.MemberListDecorators.__getDecorators($1),"
}
},
{
find: "PrivateChannel.renderAvatar",
- replacement: {
- match: /(subText:(.{1,2})\.renderSubtitle\(\).{1,50}decorators):(.{30,100}:null)/,
- replace: "$1:Vencord.Api.MemberListDecorators.__addDecoratorsToList($2.props).concat($3)"
- }
+ replacement: [
+ // props are shadowed by nested props so we have to do this
+ {
+ match: /\i=(\i)\.applicationStream,/,
+ replace: "$&vencordProps=$1,"
+ },
+ {
+ match: /decorators:(\i\.isSystemDM\(\))\?(.+?):null/,
+ replace: "decorators:[...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)), $1?$2:null]"
+ }
+ ]
}
],
});