github gotd/td v0.168.0

one hour ago

Keeping a client that poses as Telegram Desktop consistent: DeviceTDesktopWindows claims the Desktop version of the schema layer, tdata sessions tell which Desktop last ran them, and cmd/layermap checks that a module's gotd won't downgrade them.

Features

Telegram Desktop version of a tdata (#2015)

  • tdesktop.ReadAppVersion(fs.FS) returns the newest Telegram Desktop version that wrote a tdata, from the file headers, without a passcode; tdesktop.Account.AppVersion is the same for an account read by Read/ReadFS.

  • tdesktop.CheckAppVersion(session, reported) returns *tdesktop.DowngradeError when a client would report an older Desktop than the one that last ran the session, which no real client does. Call it before running a session:

    err := tdesktop.CheckAppVersion(account.AppVersion, telegram.DeviceTDesktopWindows().AppVersion)
  • tdesktop.ParseAppVersion parses an app_version such as 7.4.7 x64.

cmd/layermap (#2015, #2019)

  • layermap check -tdesktop DIR [-mod DIR] TDATA... tells whether the gotd of a module may run tdata sessions: exits 0 if it may, 3 with the go get github.com/gotd/td@vX of the oldest release that covers them, 4 if no release does yet. The reported version is the one DeviceTDesktopWindows sends, or for older releases the newest stable Desktop of their layer.
  • layermap gen writes a table of Telegram Desktop releases by layer with DesktopVersion(layer), for clients with their own device config.

Fixes

  • DeviceTDesktopWindows sent app version 6.9.1 on layer 234, the layer of Telegram Desktop 7.4.7: a pair no real Desktop sends. It now claims the version of the tdesktop commit the schema comes from, generated by cmd/dltdver in make download_schema, and a test fails if the layer and the version differ (#2014).

Full Changelog: v0.167.3...v0.168.0

Don't miss a new td release

NewReleases is sending notifications on new releases.