Slight improvement

This commit is contained in:
Daniil Gentili 2019-06-01 21:24:38 +02:00
parent 690b38e11d
commit 0c40d6fb58
3 changed files with 3 additions and 4 deletions

View File

@ -55,7 +55,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler
}
}
}
$settings = ['logger' => ['logger_level' => 5]];
$settings = ['logger' => ['logger_level' => 5], 'connection_settings' => ['all' => ['protocol' => 'https']]];
$MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings);

View File

@ -52,7 +52,7 @@ class HttpWaitLoop extends ResumableSignalLoop
$timeout = $API->settings['connection_settings'][isset($API->settings['connection_settings'][$datacenter]) ? $datacenter : 'all']['timeout'];
while (true) {
if (yield $this->waitSignal($this->pause($timeout))) {
if (yield $this->waitSignal($this->pause())) {
return;
}
if (!in_array($connection->getCtx()->getStreamName(), [HttpStream::getName(), HttpsStream::getName()])) {

View File

@ -615,7 +615,7 @@ trait ResponseHandler
if (!isset($updates['request']['body'])) {
break;
}
$updates['user_id'] = $updates['request']['body']['peer'];
$updates['user_id'] = (yield $this->get_info_async($updates['request']['body']['peer']))['bot_api_id'];
$updates['message'] = $updates['request']['body']['message'];
unset($updates['request']);
case 'updateShortMessage':
@ -625,7 +625,6 @@ trait ResponseHandler
if (!yield $this->peer_isset_async($from_id) || !yield $this->peer_isset_async($to_id) || isset($updates['via_bot_id']) && !yield $this->peer_isset_async($updates['via_bot_id']) || isset($updates['entities']) && !yield $this->entities_peer_isset_async($updates['entities']) || isset($updates['fwd_from']) && !yield $this->fwd_peer_isset_async($updates['fwd_from'])) {
yield $this->updaters[false]->resume();
return;
// TOFIX
}
$message = $updates;
$message['_'] = 'message';