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-07 00:58:31 +0100
commit80fe4764cf6a6af46352e7f83fe8c454c4a38c3a (patch)
tree19b7a421c90a3dd9177463b66e445b91eae4b4a8
parentsign 'em (diff)
downloadserver-ts-80fe4764cf6a6af46352e7f83fe8c454c4a38c3a.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 38939bb4..151b9f20 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -514,7 +514,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 a8a29b0d..6daa259f 100644 --- a/src/gateway/listener/listener.ts +++ b/src/gateway/listener/listener.ts
@@ -334,14 +334,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 08a7ba58..57fc6acf 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts
@@ -314,7 +314,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));