Унификация кодирования chacha_key_plain теперь он в hex, а не в utf8 с потерей данных

This commit is contained in:
RoyceDa
2026-03-28 17:52:13 +02:00
parent f5bfa153b6
commit 61e83bdd43
8 changed files with 23 additions and 23 deletions

View File

@@ -279,7 +279,7 @@ export function useDialogFiber() {
* Этот тип вложения приходит сразу в blob и не нуждается
* в последующем скачивании
*/
const decryptedBlob = await decodeWithPassword(chachaDecryptedKey.toString('utf-8'), attachment.blob);
const decryptedBlob = await decodeWithPassword(chachaDecryptedKey.toString('hex'), attachment.blob);
writeFile(`m/${await generateMd5(attachment.id + publicKey)}`,
Buffer.from(await encodeWithPassword(privatePlain, decryptedBlob)).toString('binary'));
messageAttachments[nextLength - 1].blob = decryptedBlob;
@@ -300,7 +300,7 @@ export function useDialogFiber() {
content: content,
timestamp: timestamp,
readed: idle ? 0 : 1,
chacha_key: chachaDecryptedKey.toString('utf-8'),
chacha_key: chachaDecryptedKey.toString('hex'),
from_me: fromPublicKey == publicKey ? 1 : 0,
plain_message: (decryptedContent as string),
delivered: DeliveredMessageState.DELIVERED,