feat: sync multilayer td integration

This commit is contained in:
A 2026-07-15 13:32:06 +08:00
parent 20a310f6ca
commit 766c5db992
491 changed files with 26235 additions and 35340 deletions

View file

@ -4,8 +4,8 @@ import (
"context"
"testing"
"github.com/gotd/td/tg"
"github.com/gotd/td/tgerr"
"github.com/iamxvbaba/td/tg"
"github.com/iamxvbaba/td/tgerr"
)
func TestStorageFileTypePrefersMagicOverMime(t *testing.T) {
@ -73,6 +73,11 @@ func TestFileLocationKeyMapsLegacyAndroidPhotoLocations(t *testing.T) {
location: &tg.InputFileLocation{VolumeID: -3999, LocalID: int('a')},
want: "photo:3999:a",
},
{
name: "plain transient response avatar",
location: &tg.InputFileLocation{VolumeID: -3999, LocalID: int('s')},
want: "photo:3999:s",
},
{
name: "plain big avatar",
location: &tg.InputFileLocation{VolumeID: -3999, LocalID: int('c')},
@ -93,6 +98,16 @@ func TestFileLocationKeyMapsLegacyAndroidPhotoLocations(t *testing.T) {
location: &tg.InputPeerPhotoFileLocationLegacy{VolumeID: -4002, LocalID: int('a'), Big: true, Peer: &tg.InputPeerSelf{}},
want: "photo:4002:c",
},
{
name: "modern response transient size",
location: &tg.InputPhotoFileLocation{ID: 4003, ThumbSize: "s"},
want: "photo:4003:s",
},
{
name: "modern peer small remains canonical a",
location: &tg.InputPeerPhotoFileLocation{PhotoID: 4004, Peer: &tg.InputPeerSelf{}},
want: "photo:4004:a",
},
{
name: "document thumb",
location: &tg.InputFileLocation{VolumeID: -1129957402753368786, LocalID: 1000 + int('m')},