mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-18 20:26:20 +00:00
it ain't async
This commit is contained in:
@@ -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));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user