Changes to save multiple attachments in same message with a different name.

pull/2917/head
Ruben Garcia 2 years ago
parent db4939c92c
commit 1b91d84b09

@ -81,6 +81,7 @@
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
"bytebuffer": "^5.0.1", "bytebuffer": "^5.0.1",
"classnames": "2.2.5", "classnames": "2.2.5",
"cmake-js": "^7.2.1",
"config": "1.28.1", "config": "1.28.1",
"country-code-lookup": "^0.0.19", "country-code-lookup": "^0.0.19",
"curve25519-js": "https://github.com/oxen-io/curve25519-js", "curve25519-js": "https://github.com/oxen-io/curve25519-js",

@ -35,6 +35,7 @@ export const DocumentListItem = (props: Props) => {
messageTimestamp: props.mediaItem.messageTimestamp, messageTimestamp: props.mediaItem.messageTimestamp,
attachment: props.mediaItem.attachment, attachment: props.mediaItem.attachment,
conversationId: selectedConversationKey, conversationId: selectedConversationKey,
index: 0,
}); });
}, [ }, [
selectedConversationKey, selectedConversationKey,

@ -98,6 +98,7 @@ export const MessageAttachment = (props: Props) => {
messageTimestamp, messageTimestamp,
messageSender: attachmentProps?.sender, messageSender: attachmentProps?.sender,
conversationId: attachmentProps?.convoId, conversationId: attachmentProps?.convoId,
index: 0,
}); });
} }
}, },

@ -132,6 +132,7 @@ const SaveAttachment = ({ messageId }: MessageId) => {
messageTimestamp, messageTimestamp,
messageSender: sender, messageSender: sender,
conversationId: convoId, conversationId: convoId,
index: targetAttachmentIndex,
}); });
}, },
[convoId, sender, attachments, serverTimestamp, timestamp] [convoId, sender, attachments, serverTimestamp, timestamp]

@ -387,11 +387,13 @@ export const saveAttachmentToDisk = async ({
messageTimestamp, messageTimestamp,
messageSender, messageSender,
conversationId, conversationId,
index,
}: { }: {
attachment: AttachmentType; attachment: AttachmentType;
messageTimestamp: number; messageTimestamp: number;
messageSender: string; messageSender: string;
conversationId: string; conversationId: string;
index: number;
}) => { }) => {
const decryptedUrl = await getDecryptedMediaUrl(attachment.url, attachment.contentType, false); const decryptedUrl = await getDecryptedMediaUrl(attachment.url, attachment.contentType, false);
save({ save({
@ -399,6 +401,7 @@ export const saveAttachmentToDisk = async ({
document, document,
getAbsolutePath: getAbsoluteAttachmentPath, getAbsolutePath: getAbsoluteAttachmentPath,
timestamp: messageTimestamp, timestamp: messageTimestamp,
index: index,
}); });
await sendDataExtractionNotification(conversationId, messageSender, messageTimestamp); await sendDataExtractionNotification(conversationId, messageSender, messageTimestamp);
}; };

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save