diff --git a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php index cdbbadc03..abc73ccd6 100644 --- a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php +++ b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php @@ -197,7 +197,7 @@ class ReferenceDatabase implements TLCallback if (!isset($this->cache[$key])) { $this->cache[$key] = []; } - $this->cache[$key][$this->serializeLocation($locationType, $location)] = (string) $location['file_reference']; + $this->cache[$key][self::serializeLocation($locationType, $location)] = (string) $location['file_reference']; return true; } public function addOriginContext(string $type): void @@ -258,7 +258,7 @@ class ReferenceDatabase implements TLCallback break; case 'channelFull': case 'channel': - $origin['peer'] = $this->API->toSupergroup($data['id']); + $origin['peer'] = $this->API::toSupergroup($data['id']); break; case 'document': foreach ($data['attributes'] as $attribute) { @@ -335,7 +335,7 @@ class ReferenceDatabase implements TLCallback foreach ($res['photos'] as $photo) { $origin['max_id'] = $photo['id']; $dc_id = $photo['dc_id']; - $location = $this->serializeLocation(self::PHOTO_LOCATION, $photo); + $location = self::serializeLocation(self::PHOTO_LOCATION, $photo); if (isset($cache[$location])) { $reference = $cache[$location]; unset($cache[$location]); @@ -346,7 +346,7 @@ class ReferenceDatabase implements TLCallback foreach ($photo['sizes'] as $size) { if (isset($size['location'])) { $size['location']['dc_id'] = $dc_id; - $location = $this->serializeLocation(self::PHOTO_LOCATION_LOCATION, $size['location']); + $location = self::serializeLocation(self::PHOTO_LOCATION_LOCATION, $size['location']); if (isset($cache[$location])) { $reference = $cache[$location]; unset($cache[$location]); @@ -407,7 +407,7 @@ class ReferenceDatabase implements TLCallback } public function refreshReference(int $locationType, array $location): \Generator { - return $this->refreshReferenceInternal($this->serializeLocation($locationType, $location)); + return $this->refreshReferenceInternal(self::serializeLocation($locationType, $location)); } public function refreshReferenceInternal(string $location): \Generator { @@ -481,7 +481,7 @@ class ReferenceDatabase implements TLCallback } public function getReference(int $locationType, array $location): \Generator { - $locationString = $this->serializeLocation($locationType, $location); + $locationString = self::serializeLocation($locationType, $location); if (!isset((yield $this->db[$locationString])['reference'])) { if (isset($location['file_reference'])) { $this->API->logger->logger("Using outdated file reference for location of type {$locationType} object {$location['_']}", \danog\MadelineProto\Logger::ULTRA_VERBOSE);