1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:34:44 +01:00

Add nghttp2 to docker image, fix issue with messages.sendMedia

This commit is contained in:
Daniil Gentili 2023-09-08 11:53:54 +02:00
parent ad5b968724
commit 6bf45181db
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
4 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

@ -15,7 +15,7 @@ RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions pcntl uv-beta ffi pq memprof intl gmp mbstring pdo_mysql xml dom iconv zip opcache igbinary && \ install-php-extensions pcntl uv-beta ffi pq memprof intl gmp mbstring pdo_mysql xml dom iconv zip opcache igbinary && \
rm /usr/local/bin/install-php-extensions rm /usr/local/bin/install-php-extensions
RUN apk add ffmpeg RUN apk add ffmpeg nghttp2
ADD ./tests/dockerfiles/php.ini /usr/local/etc/php/php.ini ADD ./tests/dockerfiles/php.ini /usr/local/etc/php/php.ini

View File

@ -299,7 +299,7 @@ function sendMedia(API $MadelineProto, array $media, string $message, string $me
$medias = [ $medias = [
'base' => $media 'base' => $media
]; ];
/*if (isset($media['file']) && is_string($media['file'])) { if (isset($media['file']) && is_string($media['file'])) {
$MadelineProto->sendDocument( $MadelineProto->sendDocument(
peer: $peer, peer: $peer,
file: new ReadableBuffer(read($media['file'])), file: new ReadableBuffer(read($media['file'])),
@ -323,7 +323,7 @@ function sendMedia(API $MadelineProto, array $media, string $message, string $me
$media, $media,
['url' => new FileCallback($media['url'], fn ($v) => $MadelineProto->logger(...))] ['url' => new FileCallback($media['url'], fn ($v) => $MadelineProto->logger(...))]
); );
}*/ }
foreach ($medias as $subtype => $m) { foreach ($medias as $subtype => $m) {
$MadelineProto->logger("Sending $type $subtype"); $MadelineProto->logger("Sending $type $subtype");
$dl = $MadelineProto->extractMessage($MadelineProto->messages->sendMedia(['peer' => $peer, 'media' => $m, 'message' => '['.$message.'](mention:'.$mention.')', 'parse_mode' => 'markdown'])); $dl = $MadelineProto->extractMessage($MadelineProto->messages->sendMedia(['peer' => $peer, 'media' => $m, 'message' => '['.$message.'](mention:'.$mention.')', 'parse_mode' => 'markdown']));