fix: add lid sutff to message.key type (#1586)

* fix: add lid sutff to message.key type

* feat: add view once information to msg key
This commit is contained in:
Cassio Santos
2025-07-03 17:08:58 -03:00
committed by GitHub
parent 8391c02e0b
commit 9b5afc8c6b
2 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { SignalRepository, WAMessageKey } from '../Types'
import { SignalRepository, WAMessage, WAMessageKey } from '../Types'
import {
areJidsSameUser,
BinaryNode,
@@ -118,7 +118,7 @@ export function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: strin
...(msgType === 'newsletter' && stanza.attrs.server_id ? { server_id: stanza.attrs.server_id } : {})
}
const fullMessage: proto.IWebMessageInfo = {
const fullMessage: WAMessage = {
key,
messageTimestamp: +stanza.attrs.t,
pushName: pushname,
@@ -158,6 +158,10 @@ export const decryptMessageNode = (
fullMessage.verifiedBizName = details.verifiedName
}
if (tag === 'unavailable' && attrs.type === 'view_once') {
fullMessage.key.isViewOnce = true
}
if (tag !== 'enc' && tag !== 'plaintext') {
continue
}