From a0de3ebfdeb1cc3761c721bfbc1949a9ed2a7f1c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 6 Apr 2024 23:33:55 +0200 Subject: [PATCH] Fixes --- src/MTProtoTools/PeerDatabase.php | 6 ++++++ src/TL/Conversion/BotAPIFiles.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/MTProtoTools/PeerDatabase.php b/src/MTProtoTools/PeerDatabase.php index 8f0351c54..0ae29a501 100644 --- a/src/MTProtoTools/PeerDatabase.php +++ b/src/MTProtoTools/PeerDatabase.php @@ -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(); diff --git a/src/TL/Conversion/BotAPIFiles.php b/src/TL/Conversion/BotAPIFiles.php index c83396b2a..cbb17d861 100644 --- a/src/TL/Conversion/BotAPIFiles.php +++ b/src/TL/Conversion/BotAPIFiles.php @@ -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,