general: revert #1665

This commit is contained in:
Rajeh Taher
2025-10-03 18:14:30 +03:00
parent 55f09e8c84
commit 334977f983
29 changed files with 51841 additions and 3500 deletions
+3 -5
View File
@@ -18,7 +18,6 @@ import {
} from '../WABinary'
import { unpadRandomMax16 } from './generics'
import type { ILogger } from './logger'
import { decodeAndHydrate } from './proto-utils'
const getDecryptionJid = async (sender: string, repository: SignalRepositoryWithLIDStore): Promise<string> => {
if (sender.includes('@lid')) {
@@ -239,8 +238,8 @@ export const decryptMessageNode = (
if (Array.isArray(stanza.content)) {
for (const { tag, attrs, content } of stanza.content) {
if (tag === 'verified_name' && content instanceof Uint8Array) {
const cert = decodeAndHydrate(proto.VerifiedNameCertificate, content)
const details = proto.VerifiedNameCertificate.Details.decode(cert.details)
const cert = proto.VerifiedNameCertificate.decode(content)
const details = proto.VerifiedNameCertificate.Details.decode(cert.details!)
fullMessage.verifiedBizName = details.verifiedName
}
@@ -294,8 +293,7 @@ export const decryptMessageNode = (
throw new Error(`Unknown e2e type: ${e2eType}`)
}
let msg: proto.IMessage = decodeAndHydrate(
proto.Message,
let msg: proto.IMessage = proto.Message.decode(
e2eType !== 'plaintext' ? unpadRandomMax16(msgBuffer) : msgBuffer
)
msg = msg.deviceSentMessage?.message || msg