fix: report macos product version in presence

This commit is contained in:
Peter Steinberger
2025-12-28 14:34:07 +00:00
parent 255a875a2a
commit 3bb4c0c237
2 changed files with 9 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
- macOS menu now refreshes the control channel after the gateway starts and shows “Connecting to gateway…” while the gateway is coming up.
- macOS local mode now waits for the gateway to be ready before configuring the control channel, avoiding false “no connection” flashes.
- WhatsApp watchdog now forces a reconnect even if the socket close event stalls (force-close to unblock reconnect loop).
- Gateway presence now reports macOS product version (via `sw_vers`) instead of Darwin kernel version.
## 2.0.0-beta3 — 2025-12-27

View File

@@ -69,10 +69,17 @@ function initSelfPresence() {
}
return os.arch();
})();
const macOSVersion = () => {
const res = spawnSync("sw_vers", ["-productVersion"], {
encoding: "utf-8",
});
const out = typeof res.stdout === "string" ? res.stdout.trim() : "";
return out.length > 0 ? out : os.release();
};
const platform = (() => {
const p = os.platform();
const rel = os.release();
if (p === "darwin") return `macos ${rel}`;
if (p === "darwin") return `macos ${macOSVersion()}`;
if (p === "win32") return `windows ${rel}`;
return `${p} ${rel}`;
})();