наверное работает

This commit is contained in:
AidarKC
2026-04-21 01:04:05 +03:00
parent 2d48ae7a16
commit 185ba5b1d3
12 changed files with 186 additions and 34 deletions
+31
View File
@@ -348,6 +348,37 @@ export function markOutgoingReadByBaseKey(baseKey) {
});
}
export function markIncomingReadByBaseKey(baseKey) {
if (!baseKey) return;
const keys = Object.keys(state.chats || {});
keys.forEach((chatId) => {
const list = getChatMessages(chatId);
list.forEach((row) => {
if (row?.from !== 'in') return;
if (row.baseKey === baseKey) {
row.unread = false;
row.readReceiptSent = true;
persistMessageRecord(chatId, row);
}
});
});
}
export function markReadReceiptSentByBaseKey(baseKey) {
if (!baseKey) return;
const keys = Object.keys(state.chats || {});
keys.forEach((chatId) => {
const list = getChatMessages(chatId);
list.forEach((row) => {
if (row?.from !== 'in') return;
if (row.baseKey === baseKey) {
row.readReceiptSent = true;
persistMessageRecord(chatId, row);
}
});
});
}
export function addSignedMessageToChat({
chatId,
messageKey,