mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 02:34:39 +01:00
Bugfixes and improvements (subrelease)
This commit is contained in:
parent
ac7f078e8c
commit
b40a9570c0
2
docs
2
docs
@ -1 +1 @@
|
||||
Subproject commit c48c5f8c0b94cedfe0cdc2dd72a534f1d17292df
|
||||
Subproject commit 3b2fb46659932f3a812279b64f31b8933474978c
|
@ -342,6 +342,7 @@ class API extends APIFactory
|
||||
flock($realpaths['lockfile'], LOCK_UN);
|
||||
fclose($realpaths['lockfile']);
|
||||
}
|
||||
\danog\MadelineProto\Logger::log('Done serializing');
|
||||
|
||||
return $wrote;
|
||||
})());
|
||||
|
@ -165,7 +165,7 @@ class UpdateLoop extends ResumableSignalLoop
|
||||
unset($difference);
|
||||
break 2;
|
||||
case 'updates.differenceSlice':
|
||||
$state->qts($difference['state']['qts']);
|
||||
$state->qts($difference['intermediate_state']['qts']);
|
||||
foreach ($difference['new_encrypted_messages'] as &$encrypted) {
|
||||
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
|
||||
}
|
||||
|
@ -30,6 +30,8 @@ use danog\MadelineProto\MTProtoTools\UpdatesState;
|
||||
use danog\MadelineProto\Stream\MTProtoTransport\HttpsStream;
|
||||
use danog\MadelineProto\Stream\MTProtoTransport\HttpStream;
|
||||
use danog\MadelineProto\TL\TLCallback;
|
||||
use function Amp\ByteStream\getStdin;
|
||||
use function Amp\ByteStream\getInputBufferStream;
|
||||
|
||||
/**
|
||||
* Manages all of the mtproto stuff.
|
||||
|
@ -25,6 +25,8 @@ use Amp\DoH\Rfc8484StubResolver;
|
||||
use Amp\Loop;
|
||||
use function Amp\Dns\resolver;
|
||||
use function Amp\Promise\wait;
|
||||
use function Amp\ByteStream\getStdin;
|
||||
use function Amp\ByteStream\getInputBufferStream;
|
||||
|
||||
class Magic
|
||||
{
|
||||
@ -143,6 +145,8 @@ class Magic
|
||||
if (defined('SIGINT')) {
|
||||
//if (function_exists('pcntl_async_signals')) pcntl_async_signals(true);
|
||||
Loop::onSignal(SIGINT, static function () {
|
||||
getStdin()->unreference();
|
||||
getInputBufferStream()->unreference();
|
||||
Logger::log('Got sigint', Logger::FATAL_ERROR);
|
||||
die();
|
||||
});
|
||||
|
@ -121,6 +121,12 @@ cp ../phar.php ../mtproxyd .
|
||||
echo -n $TRAVIS_COMMIT > release$php$branch
|
||||
git add -A
|
||||
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
|
||||
cd ..
|
||||
echo "$TRAVIS_COMMIT_MESSAGE" | grep "Apply fixes from StyleCI" && exit
|
||||
|
@ -78,7 +78,7 @@ $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sem
|
||||
/*
|
||||
* 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');
|
||||
while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) {
|
||||
$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
|
||||
*/
|
||||
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) {
|
||||
$howmany = readline('How many calls would you like me to handle? ');
|
||||
if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) {
|
||||
$howmany = $MadelineProto->readline('How many calls would you like me to handle? ');
|
||||
$offset = 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
|
||||
@ -114,7 +114,7 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user