merge the functions

This commit is contained in:
MathMan05
2026-03-06 15:07:49 -06:00
committed by Rory&
parent ccbe60ffb6
commit 5e2d0fac01
4 changed files with 60 additions and 57 deletions
@@ -233,11 +233,15 @@ router.put(
// no await as it shouldnt block the message send function and silently catch error
postHandleMessage(message).catch((e) => console.error("[Message] post-message handler failed", e));
const sign = new NewUrlUserSignatureData({
ip: req.ip,
userAgent: req.headers["user-agent"] as string,
});
return res.json(Message.prototype.withSignedComponents.call(message.withSignedAttachments(sign), sign));
return res.json(
message.withSignedAttachments(
new NewUrlUserSignatureData({
ip: req.ip,
userAgent: req.headers["user-agent"] as string,
}),
),
);
},
);
@@ -506,11 +506,14 @@ router.post(
// no await as it shouldnt block the message send function and silently catch error
postHandleMessage(message).catch((e) => console.error("[Message] post-message handler failed", e));
const sign = new NewUrlUserSignatureData({
ip: req.ip,
userAgent: req.headers["user-agent"] as string,
});
return res.json(Message.prototype.withSignedComponents.call(Message.prototype.withSignedAttachments.call(message.toJSON(), sign), sign));
return res.json(
message.withSignedAttachments(
new NewUrlUserSignatureData({
ip: req.ip,
userAgent: req.headers["user-agent"] as string,
}),
),
);
},
);