Skip to content

Commit

Permalink
Add nghttp2 to docker image, fix issue with messages.sendMedia
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Sep 8, 2023
1 parent ad5b968 commit 6bf4518
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class API extends AbstractAPI
*
* @var string
*/
public const RELEASE = '8.0.0-beta148';
public const RELEASE = '8.0.0-beta149';
/**
* Secret chat was not found.
*
Expand Down
2 changes: 1 addition & 1 deletion src/MTProtoTools/FilesLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function processMedia(array &$media, bool $upload = false): void
'application/octet-stream'
);
}
if ($upload) {
if ($upload && !\is_array($media['file'])) {
$media['file'] = $this->upload($media['file']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/dockerfiles/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
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

Expand Down
4 changes: 2 additions & 2 deletions tests/testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function sendMedia(API $MadelineProto, array $media, string $message, string $me
$medias = [
'base' => $media
];
/*if (isset($media['file']) && is_string($media['file'])) {
if (isset($media['file']) && is_string($media['file'])) {
$MadelineProto->sendDocument(
peer: $peer,
file: new ReadableBuffer(read($media['file'])),
Expand All @@ -323,7 +323,7 @@ function sendMedia(API $MadelineProto, array $media, string $message, string $me
$media,
['url' => new FileCallback($media['url'], fn ($v) => $MadelineProto->logger(...))]
);
}*/
}
foreach ($medias as $subtype => $m) {
$MadelineProto->logger("Sending $type $subtype");
$dl = $MadelineProto->extractMessage($MadelineProto->messages->sendMedia(['peer' => $peer, 'media' => $m, 'message' => '['.$message.'](mention:'.$mention.')', 'parse_mode' => 'markdown']));
Expand Down

0 comments on commit 6bf4518

Please sign in to comment.