mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Limit unnecessary thumbnail generation
This commit is contained in:
@@ -49,7 +49,7 @@ import type {
|
||||
} from '../types/CallLink.js';
|
||||
import type {
|
||||
AttachmentDownloadJobType,
|
||||
AttachmentDownloadJobTypeType,
|
||||
MessageAttachmentType,
|
||||
} from '../types/AttachmentDownload.js';
|
||||
import type {
|
||||
GroupSendEndorsementsData,
|
||||
@@ -651,7 +651,7 @@ export const MESSAGE_ATTACHMENT_COLUMNS = [
|
||||
|
||||
export type MessageAttachmentDBType = {
|
||||
messageId: string;
|
||||
attachmentType: AttachmentDownloadJobTypeType;
|
||||
attachmentType: MessageAttachmentType;
|
||||
orderInMessage: number;
|
||||
editHistoryIndex: number | null;
|
||||
conversationId: string;
|
||||
|
||||
@@ -86,7 +86,7 @@ import {
|
||||
} from '../types/AttachmentBackup.js';
|
||||
import {
|
||||
attachmentDownloadJobSchema,
|
||||
type AttachmentDownloadJobTypeType,
|
||||
type MessageAttachmentType,
|
||||
type AttachmentDownloadJobType,
|
||||
} from '../types/AttachmentDownload.js';
|
||||
import type {
|
||||
@@ -2700,7 +2700,7 @@ function saveMessageAttachment({
|
||||
sentAt: number;
|
||||
receivedAt: number;
|
||||
receivedAtMs: number | undefined;
|
||||
attachmentType: AttachmentDownloadJobTypeType;
|
||||
attachmentType: MessageAttachmentType;
|
||||
attachment: AttachmentType;
|
||||
orderInMessage: number;
|
||||
editHistoryIndex: number | null;
|
||||
|
||||
@@ -6,9 +6,9 @@ import * as z from 'zod';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
import {
|
||||
attachmentDownloadTypeSchema,
|
||||
messageAttachmentTypeSchema,
|
||||
type AttachmentDownloadJobType,
|
||||
type AttachmentDownloadJobTypeType,
|
||||
type MessageAttachmentType,
|
||||
} from '../../types/AttachmentDownload.js';
|
||||
import type { AttachmentType } from '../../types/Attachment.js';
|
||||
import { jsonToObject, objectToJSON, sql } from '../util.js';
|
||||
@@ -28,7 +28,7 @@ export type _AttachmentDownloadJobTypeV1030 = {
|
||||
messageId: string;
|
||||
pending: number;
|
||||
timestamp: number;
|
||||
type: AttachmentDownloadJobTypeType;
|
||||
type: MessageAttachmentType;
|
||||
};
|
||||
|
||||
const attachmentDownloadJobSchemaV1040 = z
|
||||
@@ -36,7 +36,7 @@ const attachmentDownloadJobSchemaV1040 = z
|
||||
attachment: z
|
||||
.object({ size: z.number(), contentType: MIMETypeSchema })
|
||||
.passthrough(),
|
||||
attachmentType: attachmentDownloadTypeSchema,
|
||||
attachmentType: messageAttachmentTypeSchema,
|
||||
ciphertextSize: z.number(),
|
||||
contentType: MIMETypeSchema,
|
||||
digest: z.string(),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { z } from 'zod';
|
||||
import { convertUndefinedToNull } from '../../util/dropNull.js';
|
||||
import { attachmentDownloadTypeSchema } from '../../types/AttachmentDownload.js';
|
||||
import { messageAttachmentTypeSchema } from '../../types/AttachmentDownload.js';
|
||||
import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js';
|
||||
import type { MessageAttachmentDBType } from '../Interface.js';
|
||||
|
||||
@@ -35,7 +35,7 @@ export const permissiveMessageAttachmentSchema = z.object({
|
||||
messageId: z.string(),
|
||||
messageType: z.string(),
|
||||
editHistoryIndex: z.number(),
|
||||
attachmentType: attachmentDownloadTypeSchema,
|
||||
attachmentType: messageAttachmentTypeSchema,
|
||||
orderInMessage: z.number(),
|
||||
conversationId: z.string(),
|
||||
sentAt: z.number().catch(0),
|
||||
|
||||
Reference in New Issue
Block a user