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

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
+11 -6
View File
@@ -16,6 +16,7 @@ import {
state,
terminateCurrentSession,
addSignedMessageToChat,
markIncomingReadByBaseKey,
markOutgoingReadByBaseKey,
setContacts,
} from './state.js';
@@ -398,16 +399,20 @@ async function init() {
} catch {}
}
} else if (messageType === 3 || messageType === 4) {
const refBaseKey = String(payload.receiptRefBaseKey || '').trim();
if (refBaseKey) {
markOutgoingReadByBaseKey(refBaseKey);
} else {
let refBaseKey = String(payload.receiptRefBaseKey || '').trim();
if (!refBaseKey) {
try {
const ref = authService.parseReadReceiptPayload(parsed.payloadBytes);
const fallbackRefBase = `${ref.refFromLogin}|${ref.refToLogin}|${ref.refTimeMs}|${ref.refNonce}`;
markOutgoingReadByBaseKey(fallbackRefBase);
refBaseKey = `${ref.refFromLogin}|${ref.refToLogin}|${ref.refTimeMs}|${ref.refNonce}`;
} catch {}
}
if (refBaseKey) {
if (messageType === 3) {
markOutgoingReadByBaseKey(refBaseKey);
} else {
markIncomingReadByBaseKey(refBaseKey);
}
}
addAppLogEntry({
level: 'info',
source: 'signed-dm',