summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-26 14:52:04 -0600
committerRory& <root@rory.gay>2026-03-20 16:31:32 +0100
commitc718da5e9898983379d2e3e081f5598fda17614a (patch)
tree492b015522ec1e3cf9f8cef946671b77f0412073
parentsign 'em (diff)
downloadserver-ts-c718da5e9898983379d2e3e081f5598fda17614a.tar.xz
it ain't async
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts2
-rw-r--r--src/gateway/listener/listener.ts14
-rw-r--r--src/util/entities/Message.ts2
3 files changed, 8 insertions, 10 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts

index f842a3a5..ded8642a 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -506,7 +506,7 @@ router.post( ip: req.ip, userAgent: req.headers["user-agent"] as string, }); - return res.json(await Message.prototype.withSignedComponents.call(message.withSignedAttachments(sign), sign)); + return res.json(Message.prototype.withSignedComponents.call(message.withSignedAttachments(sign), sign)); }, ); diff --git a/src/gateway/listener/listener.ts b/src/gateway/listener/listener.ts
index e758849b..6b261ccc 100644 --- a/src/gateway/listener/listener.ts +++ b/src/gateway/listener/listener.ts
@@ -353,14 +353,12 @@ async function consume(this: WebSocket, opts: EventOpts) { }), ).attachments; if (data["components"]) { - data["components"] = ( - await Message.prototype.withSignedComponents.call( - data, - new NewUrlUserSignatureData({ - ip: this.ipAddress, - userAgent: this.userAgent, - }), - ) + data["components"] = Message.prototype.withSignedComponents.call( + data, + new NewUrlUserSignatureData({ + ip: this.ipAddress, + userAgent: this.userAgent, + }), ).components; } break; diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts
index cd89c6e2..1fb417a5 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts
@@ -315,7 +315,7 @@ export class Message extends BaseClass { attachments: this.attachments?.map((attachment: Attachment) => Attachment.prototype.signUrls.call(attachment, data)), }; } - async withSignedComponents(data: NewUrlUserSignatureData) { + withSignedComponents(data: NewUrlUserSignatureData) { if (!this.components || !(this.flags & Number(MessageFlags.FLAGS.IS_COMPONENTS_V2))) return { ...this }; function signMedia(media: UnfurledMediaItem) { Object.assign(media, Attachment.prototype.signUrls.call(media, data));