From 972ae1184ddeb44921dff35cfdfd9dee2f1cce16 Mon Sep 17 00:00:00 2001 From: Gir0fa Date: Wed, 27 May 2026 17:06:04 -0500 Subject: [PATCH] fix(dragify): pass message.author instead of author to onUserDragStart (#1119) * fix(dragify): pass message.author instead of author to onUserDragStart The patch passed arguments[0].author which is a nickname display object with no .id. The full user object lives at arguments[0].message.author. Also flipped onUserDragStart priority so explicit user?.id wins over DOM inspection, since the caller's passed user is authoritative. * Apply suggestions from code review Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- src/equicordplugins/dragify/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/equicordplugins/dragify/index.tsx b/src/equicordplugins/dragify/index.tsx index 1bb788f09..fa45ed4a2 100644 --- a/src/equicordplugins/dragify/index.tsx +++ b/src/equicordplugins/dragify/index.tsx @@ -216,7 +216,7 @@ export default definePlugin({ find: ']="BADGES"', replacement: { match: /(?="data-username-has-gradient")/, - replace: "draggable:!0,onDragStart:e=>$self.onUserDragStart(e,arguments[0].author),\"data-dragify-user\":!0,\"data-user-id\":arguments[0].author.id," + replace: "draggable:!0,onDragStart:e=>$self.onUserDragStart(e,arguments[0].message?.author),\"data-dragify-user\":!0,\"data-user-id\":arguments[0].message?.author?.id," } }, // Call avatars (DM/group call tiles) @@ -382,10 +382,10 @@ export default definePlugin({ if (inspection.hasAttachment) return; const rawUserId = - inspection.authorId - ?? user?.id + user?.id ?? user?.userId ?? user?.user?.id + ?? inspection.authorId ?? inspection.userId ?? null; const userId = rawUserId?.trim();