Улучшение протокола, чистка кода

This commit is contained in:
RoyceDa
2026-03-29 15:45:08 +02:00
parent 2f2a0b5376
commit 519aa8802f
9 changed files with 6 additions and 74 deletions

View File

@@ -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, AttachmentEncoding, AttachmentTransport, AttachmentType, PacketMessage } from '@/app/providers/ProtocolProvider/protocol/packets/packet.message';
import { Attachment, AttachmentTransport, 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,6 @@ export interface AttachmentMeta {
type: AttachmentType;
preview: string;
transport: AttachmentTransport;
encoding: AttachmentEncoding;
}
export interface Message {
@@ -969,8 +968,7 @@ export function DialogProvider(props: DialogProviderProps) {
blob: blob,
type: meta.type,
preview: meta.preview,
transport: meta.transport,
encoding: meta.encoding
transport: meta.transport
});
}
return attachments;

View File

@@ -107,7 +107,6 @@ export function useDeattachedSender() {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
encoding: attachment.encoding,
transport: attachment.transport
});
if(attachment.type == AttachmentType.FILE){

View File

@@ -118,8 +118,7 @@ export function useDialog() : {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
transport: attachment.transport,
encoding: attachment.encoding
transport: attachment.transport
});
if(attachment.type == AttachmentType.FILE){
/**

View File

@@ -130,7 +130,6 @@ export function useDialogFiber() {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
encoding: attachment.encoding,
transport: attachment.transport
});
}
@@ -289,7 +288,6 @@ export function useDialogFiber() {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
encoding: attachment.encoding,
transport: attachment.transport
});
}

View File

@@ -191,7 +191,6 @@ export function useSynchronize() {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
encoding: attachment.encoding,
transport: attachment.transport
});
}
@@ -375,7 +374,6 @@ export function useSynchronize() {
id: attachment.id,
type: attachment.type,
preview: attachment.preview,
encoding: attachment.encoding,
transport: attachment.transport
});
}