1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:14:38 +01:00
This commit is contained in:
Daniil Gentili 2024-04-06 23:33:55 +02:00
parent 50919a1611
commit a0de3ebfde
2 changed files with 8 additions and 2 deletions

View File

@ -130,7 +130,13 @@ final class PeerDatabase implements TLCallback
ValueType::SCALAR
);
$old = $old->build();
$kk = 0;
$total = count($old);
foreach ($old as $k => $v) {
$kk++;
if ($kk % 500 === 0 || $kk === $total) {
$this->API->logger("Migrating username database ($kk/$total)...");
}
$this->usernames[$k] = $v;
}
$old->clear();

View File

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