@realvare/based 2.6.251 → 2.6.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@ const WABinary_1 = require("../WABinary");
|
|
|
16
16
|
const WAUSync_1 = require("../WAUSync");
|
|
17
17
|
const newsletter_1 = require("./newsletter");
|
|
18
18
|
const rate_limiter_1 = __importDefault(require("../Utils/rate-limiter"));
|
|
19
|
-
const { generateThumbnail } = require("../Utils/
|
|
19
|
+
const { generateThumbnail, getHttpStream, toBuffer } = require("../Utils/messages-media");
|
|
20
20
|
const makeMessagesSocket = (config) => {
|
|
21
21
|
const { logger, linkPreviewImageThumbnailWidth, generateHighQualityLinkPreview, options: axiosOptions, patchMessageBeforeSending, cachedGroupMetadata, } = config;
|
|
22
22
|
const sock = (0, newsletter_1.makeNewsletterSocket)(config);
|
|
@@ -280,7 +280,9 @@ const makeMessagesSocket = (config) => {
|
|
|
280
280
|
if(message.contextInfo?.externalAdReply?.thumbnailUrl) {
|
|
281
281
|
try {
|
|
282
282
|
const { externalAdReply } = message.contextInfo;
|
|
283
|
-
const
|
|
283
|
+
const stream = await getHttpStream(externalAdReply.thumbnailUrl);
|
|
284
|
+
const buffer = await toBuffer(stream);
|
|
285
|
+
const { thumbnail } = await generateThumbnail(buffer, 'image', { logger });
|
|
284
286
|
message.contextInfo.externalAdReply = {
|
|
285
287
|
...externalAdReply,
|
|
286
288
|
thumbnail,
|