mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update decode-wa-message.ts
This commit is contained in:
@@ -2,7 +2,7 @@ import { Boom } from '@hapi/boom'
|
||||
import { Logger } from 'pino'
|
||||
import { proto } from '../../WAProto'
|
||||
import { SignalRepository, WAMessageKey } from '../Types'
|
||||
import { areJidsSameUser, BinaryNode, isJidBroadcast, isJidGroup, isJidStatusBroadcast, isJidUser } from '../WABinary'
|
||||
import { areJidsSameUser, BinaryNode, isJidBroadcast, isJidGroup, isJidStatusBroadcast, isJidUser, isLidUser } from '../WABinary'
|
||||
import { unpadRandomMax16 } from './generics'
|
||||
|
||||
const NO_MESSAGE_FOUND_ERROR_TEXT = 'Message absent from node'
|
||||
@@ -39,6 +39,19 @@ export function decodeMessageNode(
|
||||
chatId = from
|
||||
}
|
||||
|
||||
msgType = 'chat'
|
||||
author = from
|
||||
} else if (isLidUser(from)) {
|
||||
if(recipient) {
|
||||
if(!isMe(from)) {
|
||||
throw new Boom('receipient present, but msg not from me', { data: stanza })
|
||||
}
|
||||
|
||||
chatId = recipient
|
||||
} else {
|
||||
chatId = from
|
||||
}
|
||||
|
||||
msgType = 'chat'
|
||||
author = from
|
||||
} else if(isJidGroup(from)) {
|
||||
@@ -183,4 +196,4 @@ export const decryptMessageNode = (
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user