decode-wa-message, process-message: Fix @hosted lids processing

This commit is contained in:
Rajeh Taher
2025-10-03 00:05:01 +03:00
parent 592f70b81d
commit 50b36ece3b
6 changed files with 39 additions and 14 deletions
-2
View File
@@ -1122,7 +1122,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
decrypt
} = decryptMessageNode(node, authState.creds.me!.id, authState.creds.me!.lid || '', signalRepository, logger)
const alt = msg.key.participantAlt || msg.key.remoteJidAlt
// store new mappings we didn't have before
if (!!alt) {
@@ -1235,7 +1234,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
cleanMessage(msg, authState.creds.me!.id)
await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify')
})
])
+2 -1
View File
@@ -295,8 +295,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
const lidResults = result.list.filter(a => !!a.lid)
if (lidResults.length > 0) {
logger.trace('Storing LID maps from device call')
await signalRepository.lidMapping.storeLIDPNMappings(lidResults.map(a => ({lid: a.lid as string, pn: a.id})))
await signalRepository.lidMapping.storeLIDPNMappings(lidResults.map(a => ({ lid: a.lid as string, pn: a.id })))
}
const extracted = extractDeviceJids(result?.list, authState.creds.me!.id, ignoreZeroDevices)
const deviceMap: { [_: string]: FullJid[] } = {}
+1 -1
View File
@@ -289,7 +289,7 @@ export const makeSocket = (config: SocketConfig) => {
}
const pnFromLIDUSync = async (jids: string[]): Promise<LIDMapping[] | undefined> => {
let usyncQuery = new USyncQuery().withLIDProtocol().withContext('background')
const usyncQuery = new USyncQuery().withLIDProtocol().withContext('background')
for (const jid of jids) {
if (isLidUser(jid)) {