Allow send with edited link preview

This commit is contained in:
Fedor Indutny 2024-07-18 10:16:16 -07:00 committed by GitHub
parent 1e57db6aa4
commit 2dc8a5a7e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View file

@ -16,6 +16,7 @@ import * as Errors from '../types/errors';
import type { StickerPackType as StickerPackDBType } from '../sql/Interface';
import type { MIMEType } from '../types/MIME';
import * as Bytes from '../Bytes';
import { sha256 } from '../Crypto';
import * as LinkPreview from '../types/LinkPreview';
import * as Stickers from '../types/Stickers';
import * as VisualAttachment from '../types/VisualAttachment';
@ -364,6 +365,7 @@ async function getPreview(
data,
size: data.byteLength,
...dimensions,
plaintextHash: Bytes.toHex(sha256(data)),
contentType: stringToMIMEType(withBlob.file.type),
blurHash,
};