Добавить ответы в DM и обновить UI чатов

This commit is contained in:
AidarKC
2026-07-10 19:27:49 +04:00
parent 0d2d7b6dc5
commit c9cfb394d7
10 changed files with 526 additions and 15 deletions
+3
View File
@@ -27,6 +27,7 @@ let toneFlip = false;
const DEFAULT_ICE_SERVERS = Object.freeze([
{ urls: 'stun:stun.l.google.com:19302' },
]);
const CALL_SUMMARY_MIN_TOTAL_MS = 5000;
function nowMs() {
return Date.now();
@@ -167,6 +168,8 @@ async function applyLocalOutgoingDmCopy(peerLogin, result) {
async function sendOutgoingCallSummaryDm(call, summaryCode) {
if (!call || call.direction !== 'out' || !call.peerLogin) return;
const totalMs = Math.max(0, nowMs() - Number(call.startedAtMs || nowMs()));
if (totalMs < CALL_SUMMARY_MIN_TOTAL_MS) return;
const text = buildOutgoingCallSummaryText(call, summaryCode);
if (!text) return;
const login = String(state?.session?.login || '').trim();