From c3a53b517e89468da63cb68db3172ff0fe381139 Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Thu, 26 Feb 2026 20:54:52 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BE=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=BA=D0=B8=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/providers/DialogProvider/DialogProvider.tsx | 11 ++++++++--- app/providers/DialogProvider/useDialogFiber.ts | 6 ++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/providers/DialogProvider/DialogProvider.tsx b/app/providers/DialogProvider/DialogProvider.tsx index 377e27d..f255ea2 100644 --- a/app/providers/DialogProvider/DialogProvider.tsx +++ b/app/providers/DialogProvider/DialogProvider.tsx @@ -295,7 +295,6 @@ export function DialogProvider(props: DialogProviderProps) { * Обработчик чтения для личных сообщений */ usePacket(0x07, async (packet : PacketRead) => { - info("Read packet received in dialog provider"); const fromPublicKey = packet.getFromPublicKey(); if(fromPublicKey == publicKey){ /** @@ -309,7 +308,10 @@ export function DialogProvider(props: DialogProviderProps) { */ return; } - if(fromPublicKey != props.dialog && !idle){ + if(idle){ + return; + } + if(fromPublicKey != props.dialog){ return; } setMessages((prev) => prev.map((msg) => { @@ -342,7 +344,10 @@ export function DialogProvider(props: DialogProviderProps) { */ return; } - if(toPublicKey != props.dialog && !idle){ + if(idle){ + return; + } + if(toPublicKey != props.dialog){ return; } setMessages((prev) => prev.map((msg) => { diff --git a/app/providers/DialogProvider/useDialogFiber.ts b/app/providers/DialogProvider/useDialogFiber.ts index c2399ce..ebcf58d 100644 --- a/app/providers/DialogProvider/useDialogFiber.ts +++ b/app/providers/DialogProvider/useDialogFiber.ts @@ -367,13 +367,11 @@ export function useDialogFiber() { return; } await updateSyncTime(Date.now()); - console.info("PACKED_READ_IM"); await runQuery(`UPDATE messages SET read = 1 WHERE from_public_key = ? AND to_public_key = ? AND account = ?`, [toPublicKey, fromPublicKey, publicKey]); - console.info("read im with params ", [fromPublicKey, toPublicKey, publicKey]); updateDialog(fromPublicKey); - log("Read packet received from " + fromPublicKey + " for " + toPublicKey); + addOrUpdateDialogCache(fromPublicKey, getDialogCache(fromPublicKey).map((message) => { - if (message.from_public_key == toPublicKey && !message.readed) { + if (message.from_public_key == publicKey && !message.readed) { console.info("Marking message as read in cache for dialog with " + fromPublicKey); console.info({ fromPublicKey, toPublicKey }); return {