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:
parent
6bf45181db
commit
ba3216b9a3
@ -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."
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user