Новый протокол кодирования и декодирования вложений
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { chacha20Decrypt, decodeWithPassword, decrypt, generateMd5 } from '@/app/workers/crypto/crypto';
|
||||
import { useDatabase } from '@/app/providers/DatabaseProvider/useDatabase';
|
||||
import { createContext, useEffect, useRef, useState } from 'react';
|
||||
import { Attachment, AttachmentType, PacketMessage } from '@/app/providers/ProtocolProvider/protocol/packets/packet.message';
|
||||
import { Attachment, AttachmentEncoding, AttachmentType, PacketMessage } from '@/app/providers/ProtocolProvider/protocol/packets/packet.message';
|
||||
import { usePrivatePlain } from '../AccountProvider/usePrivatePlain';
|
||||
import { usePublicKey } from '../AccountProvider/usePublicKey';
|
||||
import { PacketRead } from '@/app/providers/ProtocolProvider/protocol/packets/packet.read';
|
||||
@@ -47,7 +47,7 @@ export interface AttachmentMeta {
|
||||
type: AttachmentType;
|
||||
preview: string;
|
||||
transport_tag: string;
|
||||
encoded_for: string;
|
||||
encoding: AttachmentEncoding;
|
||||
transport_server: string;
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
preview: meta.preview,
|
||||
transport_server: meta.transport_server,
|
||||
transport_tag: meta.transport_tag,
|
||||
encoded_for: meta.encoded_for
|
||||
encoding: meta.encoding
|
||||
});
|
||||
}
|
||||
return attachments;
|
||||
|
||||
@@ -121,7 +121,7 @@ export function useDialog() : {
|
||||
preview: attachment.preview,
|
||||
transport_server: attachment.transport_server,
|
||||
transport_tag: attachment.transport_tag,
|
||||
encoded_for: dialog
|
||||
encoding: attachment.encoding
|
||||
});
|
||||
if(attachment.type == AttachmentType.FILE){
|
||||
/**
|
||||
|
||||
@@ -191,7 +191,7 @@ export function useSynchronize() {
|
||||
id: attachment.id,
|
||||
type: attachment.type,
|
||||
preview: attachment.preview,
|
||||
encoded_for: attachment.encoded_for,
|
||||
encoding: attachment.encoding,
|
||||
transport_server: attachment.transport_server,
|
||||
transport_tag: attachment.transport_tag
|
||||
});
|
||||
@@ -376,7 +376,7 @@ export function useSynchronize() {
|
||||
id: attachment.id,
|
||||
type: attachment.type,
|
||||
preview: attachment.preview,
|
||||
encoded_for: attachment.encoded_for,
|
||||
encoding: attachment.encoding,
|
||||
transport_server: attachment.transport_server,
|
||||
transport_tag: attachment.transport_tag
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user