Передача chachakey и начало нового протокола вложений
This commit is contained in:
@@ -216,6 +216,16 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
readUpdated = true;
|
||||
}
|
||||
let decryptKey = '';
|
||||
if(message.from_me && message.chacha_key != "" && !message.chacha_key.startsWith("sync:")){
|
||||
/**
|
||||
* Если это сообщение от нас, то проверяем, есть ли внутри chacha_key
|
||||
*/
|
||||
try{
|
||||
decryptKey = Buffer.from(await decodeWithPassword(privatePlain, message.chacha_key), 'binary').toString('utf-8');
|
||||
}catch(e) {
|
||||
decryptKey = "";
|
||||
}
|
||||
}
|
||||
if(message.from_me && message.chacha_key != "" && message.chacha_key.startsWith("sync:")){
|
||||
/**
|
||||
* Если это сообщение от нас, то проверяем, есть ли внутри chacha_key, если есть, значит это
|
||||
@@ -629,7 +639,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
blob: attachment.type == AttachmentType.MESSAGES ? await decodeWithPassword(chachaDecryptedKey.toString('utf-8'), attachment.blob) : ""
|
||||
});
|
||||
}
|
||||
|
||||
console.info(attachments);
|
||||
const newMessage : Message = {
|
||||
from_public_key: fromPublicKey,
|
||||
to_public_key: toPublicKey,
|
||||
|
||||
Reference in New Issue
Block a user