Add lid to Contact - contact sync, history sync, group participants (#1472)

This commit is contained in:
devlikeapro
2025-06-18 18:08:09 +07:00
committed by GitHub
parent 6b4dce897d
commit b8464d3665
5 changed files with 30 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ import {
getBinaryNodeChild,
getBinaryNodeChildren,
getBinaryNodeChildString,
isJidUser,
isLidUser,
jidEncode,
jidNormalizedUser
} from '../WABinary'
@@ -348,7 +350,8 @@ export const extractGroupMetadata = (result: BinaryNode) => {
participants: getBinaryNodeChildren(group, 'participant').map(({ attrs }) => {
return {
id: attrs.jid,
jid: attrs.phone_number ? jidNormalizedUser(attrs.phone_number) : undefined,
jid: isJidUser(attrs.jid) ? attrs.jid : jidNormalizedUser(attrs.phone_number),
lid: isLidUser(attrs.jid) ? attrs.jid : attrs.lid,
admin: (attrs.type || null) as GroupParticipant['admin']
}
}),