1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 05:51:14 +01:00

Improve file reference

This commit is contained in:
Daniil Gentili 2023-01-23 14:01:22 +01:00
parent e05216cc3b
commit 75290af3d6
3 changed files with 6 additions and 6 deletions

View File

@ -418,7 +418,7 @@ final class ReferenceDatabase implements TLCallback
{
if (isset($this->refreshed[$location])) {
$this->API->logger->logger('Reference already refreshed!', Logger::VERBOSE);
return ($this->db[$location])['reference'];
return (string) $this->db[$location]['reference'];
}
$locationValue = $this->db[$location];
\ksort($locationValue['origins']);
@ -474,7 +474,7 @@ final class ReferenceDatabase implements TLCallback
throw new Exception("Unknown origin type {$originType}");
}
if (isset($this->refreshed[$location])) {
return ($this->db[$location])['reference'];
return (string) $this->db[$location]['reference'];
}
}
throw new Exception('Did not refresh reference');
@ -490,7 +490,7 @@ final class ReferenceDatabase implements TLCallback
if (!isset($this->db[$locationString]['reference'])) {
if (isset($location['file_reference'])) {
$this->API->logger->logger("Using outdated file reference for location of type {$locationType} object {$location['_']}", Logger::ULTRA_VERBOSE);
return $location['file_reference'];
return (string) $location['file_reference'];
}
if (!$this->refresh) {
$this->API->logger->logger("Using null file reference for location of type {$locationType} object {$location['_']}", Logger::ULTRA_VERBOSE);
@ -502,7 +502,7 @@ final class ReferenceDatabase implements TLCallback
if ($this->refresh) {
return $this->refreshReferenceInternal($locationString);
}
return $this->db[$locationString]['reference'];
return (string) $this->db[$locationString]['reference'];
}
private static function serializeLocation(int $locationType, array $location): string
{

View File

@ -68,6 +68,7 @@ final class AppInfo extends SettingsAbstract
} elseif (isset($_SERVER['LANG'])) {
$this->setLangCode(\explode('_', $_SERVER['LANG'])[0]);
}
$this->appVersion = MTProto::RELEASE.' ('.MTProto::V.', '.Magic::$version.')';
$this->init();
}
public function __wakeup(): void
@ -81,7 +82,6 @@ final class AppInfo extends SettingsAbstract
if (isset(Lang::$lang[$this->langCode])) {
Lang::$current_lang =& Lang::$lang[$this->langCode];
}
$this->appVersion = MTProto::RELEASE.' ('.MTProto::V.', '.Magic::$version.')';
}
public function mergeArray(array $settings): void

View File

@ -55,7 +55,7 @@ final class Snitch
if (\count($this->hadInstalled) > self::MAX_NO_PHAR_STARTS) {
\array_shift($this->hadInstalled);
if (!\array_sum($this->hadInstalled)) { // For three times, MadelineProto was started with no phar file
$this->die();
//$this->die();
}
}
}