mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-09 20:22:47 +01:00
Check nonce in Message send
This commit is contained in:
parent
685f87703a
commit
f35c8a1f49
@ -201,6 +201,19 @@ router.post(
|
||||
);
|
||||
}
|
||||
|
||||
if (body.nonce) {
|
||||
const existing = await Message.findOne({
|
||||
where: {
|
||||
nonce: body.nonce,
|
||||
channel_id: channel.id,
|
||||
author_id: req.user_id
|
||||
}
|
||||
});
|
||||
if (existing) {
|
||||
return res.json(existing);
|
||||
}
|
||||
}
|
||||
|
||||
const files = (req.files as Express.Multer.File[]) ?? [];
|
||||
for (var currFile of files) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user