mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update messages-send.ts
This commit is contained in:
@@ -378,7 +378,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
devices.push(...additionalDevices)
|
devices.push(...additionalDevices)
|
||||||
}
|
}
|
||||||
|
|
||||||
const patched = await patchMessageBeforeSending(message, devices.map(d => jidEncode(d.user, 's.whatsapp.net', d.device)))
|
const patched = await patchMessageBeforeSending(message, devices.map(d => jidEncode(d.user, d.domainType == 0 ? 's.whatsapp.net' : 'lid', d.device)))
|
||||||
const bytes = encodeWAMessage(patched)
|
const bytes = encodeWAMessage(patched)
|
||||||
|
|
||||||
const { ciphertext, senderKeyDistributionMessage } = await signalRepository.encryptGroupMessage(
|
const { ciphertext, senderKeyDistributionMessage } = await signalRepository.encryptGroupMessage(
|
||||||
@@ -391,8 +391,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
const senderKeyJids: string[] = []
|
const senderKeyJids: string[] = []
|
||||||
// ensure a connection is established with every device
|
// ensure a connection is established with every device
|
||||||
for(const { user, device } of devices) {
|
for(const { user, device,domainType } of devices) {
|
||||||
const jid = jidEncode(user, 's.whatsapp.net', device)
|
const jid = jidEncode(user, domainType == 0 ? 's.whatsapp.net' : 'lid', device)
|
||||||
if(!senderKeyMap[jid] || !!participant) {
|
if(!senderKeyMap[jid] || !!participant) {
|
||||||
senderKeyJids.push(jid)
|
senderKeyJids.push(jid)
|
||||||
// store that this person has had the sender keys sent to them
|
// store that this person has had the sender keys sent to them
|
||||||
@@ -444,8 +444,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
const allJids: string[] = []
|
const allJids: string[] = []
|
||||||
const meJids: string[] = []
|
const meJids: string[] = []
|
||||||
const otherJids: string[] = []
|
const otherJids: string[] = []
|
||||||
for(const { user, device } of devices) {
|
for(const { user, device,domainType } of devices) {
|
||||||
const jid = jidEncode(user, 's.whatsapp.net', device)
|
const jid = jidEncode(user, domainType == 0 ?'s.whatsapp.net' : 'lid', device)
|
||||||
const isMe = user === meUser
|
const isMe = user === meUser
|
||||||
if(isMe) {
|
if(isMe) {
|
||||||
meJids.push(jid)
|
meJids.push(jid)
|
||||||
|
|||||||
Reference in New Issue
Block a user