mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: send message to LID addressing_mode groups
This commit is contained in:
@@ -339,6 +339,7 @@ export const extractGroupMetadata = (result: BinaryNode) => {
|
|||||||
const memberAddMode = getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add'
|
const memberAddMode = getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add'
|
||||||
const metadata: GroupMetadata = {
|
const metadata: GroupMetadata = {
|
||||||
id: groupId,
|
id: groupId,
|
||||||
|
addressingMode: group.attrs.addressing_mode,
|
||||||
subject: group.attrs.subject,
|
subject: group.attrs.subject,
|
||||||
subjectOwner: group.attrs.s_o,
|
subjectOwner: group.attrs.s_o,
|
||||||
subjectTime: +group.attrs.s_t,
|
subjectTime: +group.attrs.s_t,
|
||||||
|
|||||||
@@ -406,6 +406,13 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
participantsList.push(...statusJidList)
|
participantsList.push(...statusJidList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isStatus) {
|
||||||
|
additionalAttributes = {
|
||||||
|
...additionalAttributes,
|
||||||
|
addressing_mode: groupData?.addressingMode || 'pn'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const additionalDevices = await getUSyncDevices(participantsList, !!useUserDevicesCache, false)
|
const additionalDevices = await getUSyncDevices(participantsList, !!useUserDevicesCache, false)
|
||||||
devices.push(...additionalDevices)
|
devices.push(...additionalDevices)
|
||||||
}
|
}
|
||||||
@@ -429,7 +436,7 @@ 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 } of devices) {
|
||||||
const jid = jidEncode(user, isLid ? 'lid' : 's.whatsapp.net', device)
|
const jid = jidEncode(user, groupData?.addressingMode ? 'lid' : 's.whatsapp.net', 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
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin
|
|||||||
|
|
||||||
export interface GroupMetadata {
|
export interface GroupMetadata {
|
||||||
id: string
|
id: string
|
||||||
|
/** group uses 'lid' or 'pn' to send messages */
|
||||||
|
addressingMode: string
|
||||||
owner: string | undefined
|
owner: string | undefined
|
||||||
subject: string
|
subject: string
|
||||||
/** group subject owner */
|
/** group subject owner */
|
||||||
|
|||||||
Reference in New Issue
Block a user