Do not try to download text attachments
This commit is contained in:
parent
0a0fabd2ca
commit
0f16ef5dd6
5 changed files with 6 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -2569,7 +2569,8 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
|
||||
const shouldHoldOffDownload =
|
||||
(isStory(message.attributes) && !queueStoryForDownload) ||
|
||||
((isImage(attachments) || isVideo(attachments)) &&
|
||||
(!isStory(message.attributes) &&
|
||||
(isImage(attachments) || isVideo(attachments)) &&
|
||||
isInCall(reduxState));
|
||||
|
||||
if (
|
||||
|
|
|
@ -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 ||
|
||||
|
|
|
@ -723,7 +723,7 @@ export function isGIF(attachments?: ReadonlyArray<AttachmentType>): 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 {
|
||||
|
|
|
@ -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}`
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue