Minor bugfixes

This commit is contained in:
Daniil Gentili 2019-05-12 09:17:19 +00:00
parent 688283e3a0
commit 1c8159c412
2 changed files with 3 additions and 4 deletions

View File

@ -22,7 +22,6 @@ namespace danog\MadelineProto\MTProtoTools;
use Amp\Deferred;
use Amp\Promise;
use danog\MadelineProto\Async\Parameters;
use function Amp\call;
use function Amp\Promise\all;
/**
@ -91,7 +90,7 @@ trait CallHandler
public function method_call_async_write($method, $args = [], $aargs = ['msg_id' => null, 'heavy' => false]): Promise
{
return call([$this, 'method_call_async_write_generator'], $method, $args, $aargs);
return $this->call($this->method_call_async_write_generator($method, $args, $aargs));
}
public function method_call_async_write_generator($method, $args = [], $aargs = ['msg_id' => null, 'heavy' => false]): \Generator
@ -139,7 +138,7 @@ trait CallHandler
$message = ['_' => $method, 'type' => $this->methods->find_by_method($method)['type'], 'content_related' => $this->content_related($method), 'promise' => $deferred, 'method' => true, 'unencrypted' => $this->datacenter->sockets[$aargs['datacenter']]->temp_auth_key === null && strpos($method, '.') === false];
if (is_object($args) && $args instanceof Parameters) {
$message['body'] = call([$args, 'fetchParameters']);
$message['body'] = $this->call($args->fetchParameters());
} else {
$message['body'] = $args;
}

View File

@ -223,7 +223,7 @@ trait Tools
public function after($a, $b)
{
$a = $this->call($a);
$a = $this->call($a());
$deferred = new Deferred();
$a->onResolve(function ($e, $res) use ($b, $deferred) {
if ($e) {