1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 06:59:01 +01:00

Avoid infinite file reference refresh loops in case of unreachable media

This commit is contained in:
Daniil Gentili 2024-04-06 19:03:02 +02:00
parent 8fca83f8e6
commit ad753e7229

View File

@ -291,7 +291,9 @@ trait ResponseHandler
if ($response['error_message'] === 'PERSISTENT_TIMESTAMP_OUTDATED') {
$response['error_code'] = 500;
}
if (str_starts_with($response['error_message'], 'FILE_REFERENCE_')) {
if (str_starts_with($response['error_message'], 'FILE_REFERENCE_')
&& $request->shouldRefreshReferences()
) {
$this->API->logger("Got {$response['error_message']}, refreshing file reference and repeating method call...");
$this->gotResponseForOutgoingMessage($request);
$msgId = $request->getMsgId();