mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix(master): generate new message id
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { proto } from '../../WAProto'
|
||||
import { GroupMetadata, GroupParticipant, ParticipantAction, SocketConfig, WAMessageKey, WAMessageStubType } from '../Types'
|
||||
import { generateMessageID, unixTimestampSeconds } from '../Utils'
|
||||
import { generateMessageID, generateMessageIDV2, unixTimestampSeconds } from '../Utils'
|
||||
import { BinaryNode, getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString, jidEncode, jidNormalizedUser } from '../WABinary'
|
||||
import { makeChatsSocket } from './chats'
|
||||
|
||||
@@ -272,7 +272,7 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
{
|
||||
key: {
|
||||
remoteJid: inviteMessage.groupJid,
|
||||
id: generateMessageID(),
|
||||
id: generateMessageIDV2(sock.user?.id),
|
||||
fromMe: false,
|
||||
participant: key.remoteJid,
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import NodeCache from 'node-cache'
|
||||
import { proto } from '../../WAProto'
|
||||
import { DEFAULT_CACHE_TTLS, WA_DEFAULT_EPHEMERAL } from '../Defaults'
|
||||
import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types'
|
||||
import { aggregateMessageKeysNotFromMe, assertMediaContent, bindWaitForEvent, decryptMediaRetryData, encodeSignedDeviceIdentity, encodeWAMessage, encryptMediaRetryRequest, extractDeviceJids, generateMessageID, generateWAMessage, getStatusCodeForMediaRetry, getUrlFromDirectPath, getWAUploadToServer, parseAndInjectE2ESessions, unixTimestampSeconds } from '../Utils'
|
||||
import { aggregateMessageKeysNotFromMe, assertMediaContent, bindWaitForEvent, decryptMediaRetryData, encodeSignedDeviceIdentity, encodeWAMessage, encryptMediaRetryRequest, extractDeviceJids, generateMessageID, generateMessageIDV2, generateWAMessage, getStatusCodeForMediaRetry, getUrlFromDirectPath, getWAUploadToServer, parseAndInjectE2ESessions, unixTimestampSeconds } from '../Utils'
|
||||
import { getUrlInfo } from '../Utils/link-preview'
|
||||
import { areJidsSameUser, BinaryNode, BinaryNodeAttributes, getBinaryNodeChild, getBinaryNodeChildren, isJidGroup, isJidUser, jidDecode, jidEncode, jidNormalizedUser, JidWithDevice, S_WHATSAPP_NET } from '../WABinary'
|
||||
import { makeGroupsSocket } from './groups'
|
||||
@@ -314,7 +314,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const isStatus = jid === statusJid
|
||||
const isLid = server === 'lid'
|
||||
|
||||
msgId = msgId || generateMessageID()
|
||||
msgId = msgId || generateMessageIDV2(sock.user?.id)
|
||||
useUserDevicesCache = useUserDevicesCache !== false
|
||||
|
||||
const participants: BinaryNode[] = []
|
||||
@@ -740,6 +740,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
upload: waUploadToServer,
|
||||
mediaCache: config.mediaCache,
|
||||
options: config.options,
|
||||
messageId: generateMessageIDV2(sock.user?.id),
|
||||
...options,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user