mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-25 22:42:09 +00:00
Attempt to set channel/message id for attachments in more places
This commit is contained in:
@@ -189,7 +189,7 @@ router.put(
|
||||
|
||||
if (req.file) {
|
||||
try {
|
||||
const file = await uploadFile(`/attachments/${req.params.channel_id}`, req.file);
|
||||
const file = await uploadFile(`/attachments/${req.params.channel_id}/${message_id}`, req.file);
|
||||
attachments.push(Attachment.create(file));
|
||||
} catch (error) {
|
||||
return res.status(400).json(error);
|
||||
|
||||
@@ -176,6 +176,7 @@ async function processMedia(media: UnfurledMediaItem, messageId: string, batchId
|
||||
width: attEnt.width,
|
||||
content_type: attEnt.contentType || attEnt.userOriginalContentType,
|
||||
channel_id: channel.id,
|
||||
message_id: messageId,
|
||||
});
|
||||
await realAtt.save();
|
||||
|
||||
@@ -404,6 +405,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
|
||||
width: attEnt.width,
|
||||
content_type: attEnt.contentType || attEnt.userOriginalContentType,
|
||||
channel_id: channel.id,
|
||||
message_id: message.id,
|
||||
});
|
||||
await realAtt.save();
|
||||
return { attachment: realAtt, index: att.index };
|
||||
|
||||
Reference in New Issue
Block a user