Skip to main content

Crate opentele2_versions

Crate opentele2_versions 

Source
Expand description

Current official Telegram client versions, fetched from their public release feeds, plus the stable Chrome and Firefox versions the web fingerprints use, as a patch onto opentele2_core::api::Versions.

fetch_all queries the nine sources (Telegram Desktop, Android, Telegram X, iOS, macOS, Web K, Web A, Chrome, Firefox) in parallel over blocking HTTP with rustls and merges whatever answered into a VersionsPatch. A source that fails or times out only leaves its fields unset. VersionsPatch::apply writes the patch onto a Versions field by field.

The parsing of every response lives in parse as pure functions, so it is testable without the network.

Modules§

parse
Pure parsers, one per version source, including the Chrome and Firefox release feeds the web fingerprints use.

Structs§

VersionsPatch
The fields of Versions the sources returned; None for every field no source answered with a non-empty value.

Constants§

API_USER_AGENT
The user agent sent to the JSON and plain-text sources.
DEFAULT_TIMEOUT
The default per-request timeout.
TG_USER_AGENT
The browser user agent sent to t.me.

Functions§

fetch_all
Fetches every source in parallel, one thread each, and merges the answers. timeout bounds each HTTP request; a source with a fallback makes at most two.