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

Merge branch 'master' of github.com:danog/MadelineProto

This commit is contained in:
Daniil Gentili 2019-12-26 15:14:41 +01:00
commit bc17422418
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 12 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class MyTelegramOrgWrapper
if ($this->settings === null) {
$this->settings = [];
}
if (!$this->jar) {
if (!$this->jar || !($this->jar instanceof InMemoryCookieJar)) {
$this->jar = new InMemoryCookieJar;
}
$this->settings = MTProto::getSettings($this->settings);

View File

@ -191,6 +191,8 @@ class ADNLConnection
''
);
(yield $this->stream->getWriteBuffer(\strlen($data)))->bufferWrite($data);
return ($this->requests[$id] = new Deferred)->promise();
$this->requests[$id] = new Deferred;
return $this->requests[$id]->promise();
}
}

View File

@ -54,6 +54,9 @@ cd ..
composer global require spatie/7to5 dev-master#0420ad3
[ -f $HOME/.composer/vendor/bin/php7to5 ] && php7to5=$HOME/.composer/vendor/bin/php7to5
[ -f $HOME/.config/composer/vendor/bin/php7to5 ] && php7to5=$HOME/.config/composer/vendor/bin/php7to5
find phar7/vendor/league/uri -type f -name '*.php' -exec sed 's/withScheme[(]\$scheme[)]: UriInterface/withScheme(?string $scheme): UriInterface/g' -i {} +
php7.3 $php7to5 convert --copy-all phar7 phar5 >/dev/null
@ -64,8 +67,8 @@ cd ..
sed 's/namespace danog\\MadelineProto;/namespace Amp;/g' -i phar5/vendor/amphp/amp/lib/Coroutine.php
sed 's/public static function echo/public static function echo_/g' -i phar5/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php
find phar5/vendor/amphp -type f -name '*.php' -exec sed "s/extension_loaded[(]'zlib'[)]/false/g" -i {} +
find phar5/vendor/amphp -type f -name '*.php' -exec sed "s/extension_loaded[(]'zlib'[)]/false/g;s/new[(]/new_(/g;s/clone[(]/clone_(/g" -i {} +
find phar5/vendor/danog/madelineproto -type f -name '*.php' -exec sed 's/: EncryptableSocket/: \\Amp\\Socket\\Socket/g' -i {} +
php -v
@ -77,8 +80,11 @@ cd ..
composer global require danog/7to70
[ -f $HOME/.composer/vendor/bin/php7to70 ] && php7to70=$HOME/.composer/vendor/bin/php7to70
[ -f $HOME/.config/composer/vendor/bin/php7to70 ] && php7to70=$HOME/.config/composer/vendor/bin/php7to70
find phar7/vendor/league/uri -type f -name '*.php' -exec sed 's/withScheme[(]\$scheme[)]: UriInterface/withScheme(?string $scheme): UriInterface/g' -i {} +
$php7to70 convert --copy-all phar7 phar5 >/dev/null
find phar5/vendor/danog/madelineproto -type f -name '*.php' -exec sed 's/: EncryptableSocket/: \\Amp\\Socket\\Socket/g' -i {} +
php=70