Bugfixes and improvements (subrelease)

This commit is contained in:
Daniil Gentili 2019-06-21 21:20:44 +02:00
parent ac7f078e8c
commit b40a9570c0
7 changed files with 19 additions and 6 deletions

2
docs

@ -1 +1 @@
Subproject commit c48c5f8c0b94cedfe0cdc2dd72a534f1d17292df Subproject commit 3b2fb46659932f3a812279b64f31b8933474978c

View File

@ -342,6 +342,7 @@ class API extends APIFactory
flock($realpaths['lockfile'], LOCK_UN); flock($realpaths['lockfile'], LOCK_UN);
fclose($realpaths['lockfile']); fclose($realpaths['lockfile']);
} }
\danog\MadelineProto\Logger::log('Done serializing');
return $wrote; return $wrote;
})()); })());

View File

@ -165,7 +165,7 @@ class UpdateLoop extends ResumableSignalLoop
unset($difference); unset($difference);
break 2; break 2;
case 'updates.differenceSlice': case 'updates.differenceSlice':
$state->qts($difference['state']['qts']); $state->qts($difference['intermediate_state']['qts']);
foreach ($difference['new_encrypted_messages'] as &$encrypted) { foreach ($difference['new_encrypted_messages'] as &$encrypted) {
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted]; $encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
} }

View File

@ -30,6 +30,8 @@ use danog\MadelineProto\MTProtoTools\UpdatesState;
use danog\MadelineProto\Stream\MTProtoTransport\HttpsStream; use danog\MadelineProto\Stream\MTProtoTransport\HttpsStream;
use danog\MadelineProto\Stream\MTProtoTransport\HttpStream; use danog\MadelineProto\Stream\MTProtoTransport\HttpStream;
use danog\MadelineProto\TL\TLCallback; use danog\MadelineProto\TL\TLCallback;
use function Amp\ByteStream\getStdin;
use function Amp\ByteStream\getInputBufferStream;
/** /**
* Manages all of the mtproto stuff. * Manages all of the mtproto stuff.

View File

@ -25,6 +25,8 @@ use Amp\DoH\Rfc8484StubResolver;
use Amp\Loop; use Amp\Loop;
use function Amp\Dns\resolver; use function Amp\Dns\resolver;
use function Amp\Promise\wait; use function Amp\Promise\wait;
use function Amp\ByteStream\getStdin;
use function Amp\ByteStream\getInputBufferStream;
class Magic class Magic
{ {
@ -143,6 +145,8 @@ class Magic
if (defined('SIGINT')) { if (defined('SIGINT')) {
//if (function_exists('pcntl_async_signals')) pcntl_async_signals(true); //if (function_exists('pcntl_async_signals')) pcntl_async_signals(true);
Loop::onSignal(SIGINT, static function () { Loop::onSignal(SIGINT, static function () {
getStdin()->unreference();
getInputBufferStream()->unreference();
Logger::log('Got sigint', Logger::FATAL_ERROR); Logger::log('Got sigint', Logger::FATAL_ERROR);
die(); die();
}); });

View File

@ -121,6 +121,12 @@ cp ../phar.php ../mtproxyd .
echo -n $TRAVIS_COMMIT > release$php$branch echo -n $TRAVIS_COMMIT > release$php$branch
git add -A git add -A
git commit -am "Release $TRAVIS_BRANCH - $TRAVIS_COMMIT_MESSAGE" git commit -am "Release $TRAVIS_BRANCH - $TRAVIS_COMMIT_MESSAGE"
echo "$TRAVIS_COMMIT_MESSAGE" | grep -i "subrelease" && {
cp release$php$branch release$php
cp madeline$php$branch.phar madeline$php.phar
}
git push origin master git push origin master
cd .. cd ..
echo "$TRAVIS_COMMIT_MESSAGE" | grep "Apply fixes from StyleCI" && exit echo "$TRAVIS_COMMIT_MESSAGE" | grep "Apply fixes from StyleCI" && exit

View File

@ -78,7 +78,7 @@ $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sem
/* /*
* Try making a phone call * Try making a phone call
*/ */
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y/n): '), 'y') !== false) { if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make a call? (y/n): '), 'y') !== false) {
$controller = $MadelineProto->request_call(getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw'); $controller = $MadelineProto->request_call(getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw');
while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) { while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) {
$MadelineProto->get_updates(); $MadelineProto->get_updates();
@ -92,8 +92,8 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y
/* /*
* Try receiving a phone call * Try receiving a phone call
*/ */
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) { if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) {
$howmany = readline('How many calls would you like me to handle? '); $howmany = $MadelineProto->readline('How many calls would you like me to handle? ');
$offset = 0; $offset = 0;
while ($howmany > 0) { while ($howmany > 0) {
$updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout $updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
@ -114,7 +114,7 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming
/* /*
* Secret chat usage * Secret chat usage
*/ */
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) { if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) {
/** /**
* Request a secret chat. * Request a secret chat.
*/ */