Ensure that long message attachments don't show in media gallery
This commit is contained in:
parent
ddae8708b4
commit
3feb0037e5
4 changed files with 92 additions and 14 deletions
|
@ -936,16 +936,20 @@
|
|||
);
|
||||
|
||||
// Unlike visual media, only one non-image attachment is supported
|
||||
const documents = rawDocuments.map(message => {
|
||||
const attachments = message.attachments || [];
|
||||
const attachment = attachments[0];
|
||||
return {
|
||||
contentType: attachment.contentType,
|
||||
index: 0,
|
||||
attachment,
|
||||
message,
|
||||
};
|
||||
});
|
||||
const documents = rawDocuments
|
||||
.filter(message =>
|
||||
Boolean(message.attachments && message.attachments.length)
|
||||
)
|
||||
.map(message => {
|
||||
const attachments = message.attachments || [];
|
||||
const attachment = attachments[0];
|
||||
return {
|
||||
contentType: attachment.contentType,
|
||||
index: 0,
|
||||
attachment,
|
||||
message,
|
||||
};
|
||||
});
|
||||
|
||||
const saveAttachment = async ({ attachment, message } = {}) => {
|
||||
const timestamp = message.received_at;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue