From 77b77cfa6488410ce63a7831378cb4485f9d643a Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Tue, 14 Apr 2026 17:15:55 +0800 Subject: [PATCH] fix: remove duplicate identity helper declarations --- index.js | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/index.js b/index.js index 2e7eade..a10aacf 100644 --- a/index.js +++ b/index.js @@ -4373,57 +4373,6 @@ async function importRecoveredSnapshotToIndexedDb( return snapshot; } -function doesChatIdMatchResolvedGraphIdentity( - candidateChatId, - identity = resolveCurrentChatIdentity(getContext()), -) { - const normalizedCandidate = normalizeChatIdCandidate(candidateChatId); - if (!normalizedCandidate || !identity || typeof identity !== "object") { - return false; - } - - const knownChatIds = new Set(); - const addKnownChatId = (value) => { - const normalized = normalizeChatIdCandidate(value); - if (normalized) { - knownChatIds.add(normalized); - } - }; - - addKnownChatId(identity.chatId); - addKnownChatId(identity.hostChatId); - addKnownChatId(identity.integrity); - - for (const aliasCandidate of getGraphIdentityAliasCandidates({ - integrity: identity.integrity, - hostChatId: identity.hostChatId, - persistenceChatId: identity.chatId, - })) { - addKnownChatId(aliasCandidate); - } - - return knownChatIds.has(normalizedCandidate); -} - -function areChatIdsEquivalentForResolvedIdentity( - candidateChatId, - referenceChatId, - identity = resolveCurrentChatIdentity(getContext()), -) { - const normalizedCandidate = normalizeChatIdCandidate(candidateChatId); - const normalizedReference = normalizeChatIdCandidate(referenceChatId); - if (!normalizedCandidate || !normalizedReference) { - return normalizedCandidate === normalizedReference; - } - if (normalizedCandidate === normalizedReference) { - return true; - } - return ( - doesChatIdMatchResolvedGraphIdentity(normalizedCandidate, identity) && - doesChatIdMatchResolvedGraphIdentity(normalizedReference, identity) - ); -} - function getIndexedDbSnapshotHistoryState(snapshot = null) { const snapshotState = snapshot?.meta?.runtimeHistoryState &&