mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Merge branch 'master' into invalid-qr-patch
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { proto } from '../../WAProto'
|
||||
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types'
|
||||
import { generateMessageID } from '../Utils'
|
||||
import { BinaryNode, getBinaryNodeChild, getBinaryNodeChildren, jidEncode, jidNormalizedUser } from '../WABinary'
|
||||
import { makeSocket } from './socket'
|
||||
import { proto } from '../../WAProto'
|
||||
|
||||
export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
const sock = makeSocket(config)
|
||||
@@ -137,10 +137,10 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
},
|
||||
groupAcceptInviteV4: async(jid: string, inviteMessage: proto.IGroupInviteMessage) => {
|
||||
const results = await groupQuery(inviteMessage.groupJid, 'set', [{ tag: 'accept', attrs: {
|
||||
code: inviteMessage.inviteCode,
|
||||
expiration: inviteMessage.inviteExpiration.toString(),
|
||||
admin: jid} }])
|
||||
return results.attrs.from;
|
||||
code: inviteMessage.inviteCode,
|
||||
expiration: inviteMessage.inviteExpiration.toString(),
|
||||
admin: jid } }])
|
||||
return results.attrs.from
|
||||
},
|
||||
groupToggleEphemeral: async(jid: string, ephemeralExpiration: number) => {
|
||||
const content: BinaryNode = ephemeralExpiration ?
|
||||
|
||||
@@ -4,11 +4,12 @@ import { proto } from '../../WAProto'
|
||||
import { WA_DEFAULT_EPHEMERAL } from '../Defaults'
|
||||
import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types'
|
||||
import { aggregateMessageKeysNotFromMe, encodeWAMessage, encryptSenderKeyMsgSignalProto, encryptSignalProto, extractDeviceJids, generateMessageID, generateWAMessage, getWAUploadToServer, jidToSignalProtocolAddress, parseAndInjectE2ESessions, unixTimestampSeconds } from '../Utils'
|
||||
import { getUrlInfo } from '../Utils/link-preview'
|
||||
import { BinaryNode, BinaryNodeAttributes, getBinaryNodeChild, getBinaryNodeChildren, isJidGroup, isJidUser, jidDecode, jidEncode, jidNormalizedUser, JidWithDevice, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary'
|
||||
import { makeGroupsSocket } from './groups'
|
||||
|
||||
export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const { logger } = config
|
||||
const { logger, linkPreviewImageThumbnailWidth } = config
|
||||
const sock = makeGroupsSocket(config)
|
||||
const {
|
||||
ev,
|
||||
@@ -484,7 +485,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
logger,
|
||||
userJid,
|
||||
// multi-device does not have this yet
|
||||
//getUrlInfo: generateUrlInfo,
|
||||
getUrlInfo: text => getUrlInfo(text, { thumbnailWidth: linkPreviewImageThumbnailWidth }),
|
||||
upload: waUploadToServer,
|
||||
mediaCache: config.mediaCache,
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user