diff --git a/extension/locales/en.json b/extension/locales/en.json index 786dd15..416d6b4 100644 --- a/extension/locales/en.json +++ b/extension/locales/en.json @@ -109,6 +109,7 @@ "BTN_REGEN_ID_TOOLTIP": "Regenerate your internal ID and reconnect", "REGEN_ID_DESC": "Use this if you see \"Duplicate Identity\" errors.", "REGEN_ID_OTHER_ISSUE": "Other issue? Open a GitHub Issue", + "TOAST_ID_REGENERATED": "Identity regenerated — reconnecting…", "LABEL_CONN_STATUS": "Connection Status", "LABEL_CONN_STATUS_TOOLTIP": "Current WebSocket connection state", "CONN_STATUS_DISCONNECTED": "Disconnected", diff --git a/extension/popup.js b/extension/popup.js index d1449f1..6a73613 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -1645,6 +1645,20 @@ elements.clearLogs.addEventListener('click', () => { }); }); +if (elements.regenId) { + elements.regenId.addEventListener('click', () => { + elements.regenId.disabled = true; + chrome.runtime.sendMessage({ type: 'REGENERATE_ID' }, (res) => { + elements.regenId.disabled = false; + if (chrome.runtime.lastError || !res || !res.peerId) { + showToast(getMessage('TOAST_ID_REGENERATED') || 'Failed to regenerate identity', 'error'); + return; + } + showToast(getMessage('TOAST_ID_REGENERATED') || 'Identity regenerated — reconnecting…', 'success', 3000); + }); + }); +} + elements.copyInvite.addEventListener('click', () => { navigator.clipboard.writeText(elements.inviteLink.value).then(() => { const original = elements.copyInvite.textContent; diff --git a/server/index.js b/server/index.js index 43d50b8..b3966e0 100644 --- a/server/index.js +++ b/server/index.js @@ -175,10 +175,6 @@ const SERVER_CAPABILITIES = [CAPABILITIES.HOST_CONTROL, CAPABILITIES.CO_HOST]; // from generating one broadcast per toggle across all peers. const CONTROL_MODE_MIN_INTERVAL_MS = 500; -// Co-Host: max peers (incl. the owner) allowed to drive a 'host-only' room. Bounds -// the controller set + the CONTROL_MODE payload. Beyond this, just use 'everyone'. -const MAX_CONTROLLERS = 10; - // Canonical control-mode/role snapshot sent to clients. controllers always includes // the owner (hostPeerId). Built in one place so every emit stays consistent. function controlModePayload(room) { @@ -748,11 +744,6 @@ io.on('connection', (socket) => { if (makeController) { if (room.controllers.has(targetPeerId)) return; // no-op - if (room.controllers.size >= MAX_CONTROLLERS) { - log('ROOM', `Controller cap (${MAX_CONTROLLERS}) reached in ${mapping.roomId.substring(0, 3)}***`); - socket.emit(EVENTS.CONTROL_MODE, controlModePayload(room)); // re-sync owner UI - return; - } room.controllers.add(targetPeerId); } else { if (!room.controllers.has(targetPeerId)) return; // no-op