mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: generate high quality thumbs on link preview
This commit is contained in:
@@ -10,7 +10,11 @@ import { areJidsSameUser, BinaryNode, BinaryNodeAttributes, getBinaryNodeChild,
|
||||
import { makeGroupsSocket } from './groups'
|
||||
|
||||
export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const { logger, linkPreviewImageThumbnailWidth } = config
|
||||
const {
|
||||
logger,
|
||||
linkPreviewImageThumbnailWidth,
|
||||
generateHighQualityLinkPreview
|
||||
} = config
|
||||
const sock = makeGroupsSocket(config)
|
||||
const {
|
||||
ev,
|
||||
@@ -607,7 +611,13 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
userJid,
|
||||
getUrlInfo: text => getUrlInfo(
|
||||
text,
|
||||
{ thumbnailWidth: linkPreviewImageThumbnailWidth, timeoutMs: 3_000 },
|
||||
{
|
||||
thumbnailWidth: linkPreviewImageThumbnailWidth,
|
||||
timeoutMs: 3_000,
|
||||
uploadImage: generateHighQualityLinkPreview
|
||||
? waUploadToServer
|
||||
: undefined
|
||||
},
|
||||
logger
|
||||
),
|
||||
upload: waUploadToServer,
|
||||
|
||||
Reference in New Issue
Block a user