diff --git a/ts/components/StoryImage.tsx b/ts/components/StoryImage.tsx index c02825cd8c..7074928729 100644 --- a/ts/components/StoryImage.tsx +++ b/ts/components/StoryImage.tsx @@ -52,7 +52,7 @@ export const StoryImage = ({ return null; } - const isPending = Boolean(attachment.pending); + const isPending = Boolean(attachment.pending) && !attachment.textAttachment; const isNotReadyToShow = hasNotResolved(attachment) || isPending; const getClassName = getClassNamesFor('StoryImage', moduleClassName); diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 63a67a29e8..fe22485051 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -2569,7 +2569,8 @@ export class MessageModel extends window.Backbone.Model { const shouldHoldOffDownload = (isStory(message.attributes) && !queueStoryForDownload) || - ((isImage(attachments) || isVideo(attachments)) && + (!isStory(message.attributes) && + (isImage(attachments) || isVideo(attachments)) && isInCall(reduxState)); if ( diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index 41509afb72..021969a677 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -110,7 +110,6 @@ import { } from './messageReceiverEvents'; import * as log from '../logging/log'; import * as durations from '../util/durations'; -import { IMAGE_JPEG } from '../types/MIME'; import { areArraysMatchingSets } from '../util/areArraysMatchingSets'; import { generateBlurHash } from '../util/generateBlurHash'; @@ -1803,8 +1802,7 @@ export default class MessageReceiver if (msg.textAttachment) { attachments.push({ - contentType: IMAGE_JPEG, - size: 0, + size: msg.textAttachment.text?.length, textAttachment: msg.textAttachment, blurHash: generateBlurHash( (msg.textAttachment.color || diff --git a/ts/types/Attachment.ts b/ts/types/Attachment.ts index 4293300a8c..41e2bb2c41 100644 --- a/ts/types/Attachment.ts +++ b/ts/types/Attachment.ts @@ -723,7 +723,7 @@ export function isGIF(attachments?: ReadonlyArray): boolean { } export function isDownloaded(attachment?: AttachmentType): boolean { - return Boolean(attachment && attachment.path); + return Boolean(attachment && (attachment.path || attachment.textAttachment)); } export function hasNotResolved(attachment?: AttachmentType): boolean { diff --git a/ts/util/queueAttachmentDownloads.ts b/ts/util/queueAttachmentDownloads.ts index f99f2d0e66..403d6df340 100644 --- a/ts/util/queueAttachmentDownloads.ts +++ b/ts/util/queueAttachmentDownloads.ts @@ -81,7 +81,7 @@ export async function queueAttachmentDownloads( return attachment; } // We've already downloaded this! - if (attachment.path) { + if (attachment.path || attachment.textAttachment) { log.info( `Normal attachment already downloaded for message ${idForLogging}` );