1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:14:38 +01:00

tg-file-decoder fix

This commit is contained in:
Daniil Gentili 2024-04-06 23:13:59 +02:00
parent d0c62513c4
commit 50919a1611
3 changed files with 9 additions and 3 deletions

View File

@ -832,7 +832,9 @@ trait PeerHandler
type: FileIdType::PROFILE_PHOTO,
id: $res['photo']['id'],
accessHash: $res['photo']['access_hash'],
fileReference: $res['photo']['file_reference'] ?? null,
fileReference: $res['photo']['file_reference'] === null
? null
: (string) $res['photo']['file_reference'],
photoSizeSource: $photoSize
);

View File

@ -320,7 +320,9 @@ trait BotAPI
$fileId = new FileId(
id: $data['document']['id'],
accessHash: $data['document']['access_hash'],
fileReference: $data['document']['file_reference'] ?? null,
fileReference: $data['document']['file_reference'] === null
? null
: (string) $data['document']['file_reference'],
dcId: $data['document']['dc_id'],
type: FileIdType::from($type_name)
);

View File

@ -44,7 +44,9 @@ trait BotAPIFiles
id: $photo['id'] ?? 0,
type: $photo['_'] === 'photo' ? FileIdType::PHOTO : FileIdType::THUMBNAIL,
accessHash: $photo['access_hash'] ?? 0,
fileReference: $photo['file_reference'] ?? null,
fileReference: $photo['file_reference'] === null
? null
: (string) $photo['file_reference'],
dcId: $photo['dc_id'] ?? 0,
localId: $photoSize['location']['local_id'] ?? null,
volumeId: $photoSize['location']['volume_id'] ?? null,