fn effective_device_state( state: &PresenceState, last_active_age: u64, idle_timeout_ms: u64, offline_timeout_ms: u64, ) -> PresenceState