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.AppVersionis the same for an account read byRead/ReadFS. -
tdesktop.CheckAppVersion(session, reported)returns*tdesktop.DowngradeErrorwhen 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.ParseAppVersionparses anapp_versionsuch as7.4.7 x64.
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 thego get github.com/gotd/td@vXof the oldest release that covers them, 4 if no release does yet. The reported version is the oneDeviceTDesktopWindowssends, or for older releases the newest stable Desktop of their layer.layermap genwrites a table of Telegram Desktop releases by layer withDesktopVersion(layer), for clients with their own device config.
Fixes
DeviceTDesktopWindowssent 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 bycmd/dltdverinmake download_schema, and a test fails if the layer and the version differ (#2014).
Full Changelog: v0.167.3...v0.168.0