MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / setIcloudAliasUsedState

Function setIcloudAliasUsedState

background.js:1122–1138  ·  view source on GitHub ↗
(payload = {}, options = {})

Source from the content-addressed store, hash-verified

1120}
1121
1122async function setIcloudAliasUsedState(payload = {}, options = {}) {
1123 const email = String(payload.email || '').trim().toLowerCase();
1124 if (!email) {
1125 throw new Error('未提供 iCloud 隐私邮箱地址。');
1126 }
1127
1128 const used = Boolean(payload.used);
1129 const state = await getState();
1130 const manualAliasUsage = getManualAliasUsageMap(state);
1131 manualAliasUsage[email] = used;
1132 await setState({ manualAliasUsage });
1133 if (!options.silentLog) {
1134 await addLog(`iCloud:已将 ${email} 标记为${used ? '已用' : '未用'}`, 'ok');
1135 }
1136 broadcastIcloudAliasesChanged({ reason: 'used-updated', email, used });
1137 return { email, used };
1138}
1139
1140async function setIcloudAliasPreservedState(payload = {}) {
1141 const email = String(payload.email || '').trim().toLowerCase();

Callers 2

handleMessageFunction · 0.85

Calls 5

getStateFunction · 0.85
getManualAliasUsageMapFunction · 0.85
setStateFunction · 0.85
addLogFunction · 0.70

Tested by

no test coverage detected