1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 19:24:42 +01:00

Multiple file-related fixes

This commit is contained in:
Daniil Gentili 2023-09-10 22:21:48 +02:00
parent 6bf45181db
commit ba3216b9a3
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
6 changed files with 12 additions and 4 deletions

View File

@ -162,5 +162,5 @@
"plugin_path_does_not_exist": "Plugin path %s does not exist!",
"windows_warning": "For Windows users: please switch to Linux if this fails. You can also try modifying the firewall settings to allow all PHP processes to create sockets (it's 100% easier to just switch to Linux, on Linux MadelineProto just works out of the box, no changes needed)",
"could_not_connect_to_MadelineProto": "Could not connect to MadelineProto, please enable proc_open or disable webserver path rewrites to fix! If you already did that, make sure the CLI version of PHP is exactly the same as the web version (same version, extensions, et cetera) and check out the MadelineProto.log file for more info about the error that prevented the IPC server from starting."
"could_not_connect_to_MadelineProto": "Could not connect to MadelineProto, please enable proc_open and remove open_basedir restrictions or disable webserver path rewrites to fix! If you already did that, make sure the CLI version of PHP is exactly the same as the web version (same version, extensions, et cetera) and check out the MadelineProto.log file for more info about the error that prevented the IPC server from starting."
}

View File

@ -51,7 +51,7 @@ final class API extends AbstractAPI
*
* @var string
*/
public const RELEASE = '8.0.0-beta149';
public const RELEASE = '8.0.0-beta150';
/**
* Secret chat was not found.
*

View File

@ -139,7 +139,7 @@ trait Files
}
if ($has_animated) {
if ($has_video === null) {
throw new AssertionError("has_video === null: ".\json_encode($media['document']));
return new Document($this, $media, $protected);
}
return new Gif($this, $media, $has_video, $protected);
}

View File

@ -290,7 +290,7 @@ trait FilesLogic
'application/octet-stream'
);
}
if ($upload && !\is_array($media['file'])) {
if ($upload && isset($media['file']) && !\is_array($media['file'])) {
$media['file'] = $this->upload($media['file']);
}
}

View File

@ -73,4 +73,9 @@ interface TLInterface
* @param array $type Type identifier
*/
public function deserialize($stream, array $type);
/**
* Get secret chat layer version.
*/
public function getSecretLayer(): int;
}

View File

@ -47,6 +47,9 @@ enum DiscardReason implements JsonSerializable
return null;
}
$newName = \strtoupper(\substr($name, 22));
if ($newName === 'DISCONNECT') {
return self::DISCONNECTED;
}
foreach (DiscardReason::cases() as $case) {
if ($case->name === $newName) {
return $case;