Поддержка синхронизации своих же вложений
This commit is contained in:
@@ -96,15 +96,15 @@ export function useDialogFiber() {
|
||||
const content = packet.getContent();
|
||||
const timestamp = packet.getTimestamp();
|
||||
const messageId = packet.getMessageId();
|
||||
|
||||
|
||||
if (fromPublicKey != publicKey) {
|
||||
/**
|
||||
* Игнорируем если это не сообщение от нас
|
||||
*/
|
||||
return;
|
||||
}
|
||||
const chachaDecryptedKey = Buffer.from(await decodeWithPassword(privatePlain, aesChachaKey), "binary");
|
||||
|
||||
const chachaKey = await decodeWithPassword(privatePlain, aesChachaKey);
|
||||
const chachaDecryptedKey = Buffer.from(chachaKey, "binary");
|
||||
const key = chachaDecryptedKey.slice(0, 32);
|
||||
const nonce = chachaDecryptedKey.slice(32);
|
||||
const decryptedContent = await chacha20Decrypt(content, nonce.toString('hex'), key.toString('hex'));
|
||||
@@ -160,7 +160,7 @@ export function useDialogFiber() {
|
||||
content,
|
||||
timestamp,
|
||||
0, //по умолчанию не прочитаны
|
||||
'',
|
||||
"sync:" + aesChachaKey,
|
||||
1, //Свои же сообщения всегда от нас
|
||||
await encodeWithPassword(privatePlain, decryptedContent),
|
||||
publicKey,
|
||||
|
||||
Reference in New Issue
Block a user