Add check for legacy environment variable

This commit is contained in:
James Murdza
2025-08-11 08:29:13 -04:00
parent 34d160eabd
commit 53c53e8df4

View File

@@ -60,6 +60,9 @@ def is_telemetry_globally_disabled() -> bool:
Returns:
bool: True if telemetry is globally disabled, False otherwise
"""
# Check legacy environment variable for telemetry opt-out
if os.environ.get("CUA_TELEMETRY", "").lower() == "off":
return True
# Only check for CUA_TELEMETRY_ENABLED - telemetry is enabled only if explicitly set to a truthy value
telemetry_enabled = os.environ.get("CUA_TELEMETRY_ENABLED", "true").lower()
return telemetry_enabled not in ("1", "true", "yes", "on")