This commit is contained in:
giuseppeM99 2017-08-23 21:59:29 +02:00 committed by Daniil Gentili
parent 5dfc160f1d
commit 057db34af3
2 changed files with 6 additions and 3 deletions

View File

@ -46,14 +46,16 @@ class Lua
} }
$methods = []; $methods = [];
foreach ($this->MadelineProto->get_methods_namespaced() as $pair) { foreach ($this->MadelineProto->get_methods_namespaced() as $pair) {
list($namespace, $method) = $pair; $namespace = key($pair);
$method = $pair[$namespace];
if ($namespace === 'upload') { if ($namespace === 'upload') {
continue; continue;
} }
$methods[$namespace][$method] = [$this->MadelineProto->{$namespace}, $method]; $methods[$namespace][$method] = [$this->MadelineProto->{$namespace}, $method];
} }
foreach ($this->MadelineProto->get_methods_namespaced() as $pair) { foreach ($this->MadelineProto->get_methods_namespaced() as $pair) {
list($namespace, $method) = $pair; $namespace = key($pair);
$method = $pair[$namespace];
if ($namespace === 'upload') { if ($namespace === 'upload') {
continue; continue;
} }
@ -61,6 +63,7 @@ class Lua
} }
$this->MadelineProto->lua = true; $this->MadelineProto->lua = true;
foreach ($this->MadelineProto->get_methods_namespaced() as $method => $namespace) { foreach ($this->MadelineProto->get_methods_namespaced() as $method => $namespace) {
$namespace = key($pair);
$this->MadelineProto->{$namespace}->lua = true; $this->MadelineProto->{$namespace}->lua = true;
} }
} }

View File

@ -220,7 +220,7 @@ trait TL
{ {
$res = []; $res = [];
foreach ($this->methods->method_namespace as $pair) { foreach ($this->methods->method_namespace as $pair) {
list($a, $b) = $pair; $a = key($pair);
$res[$a] = $a; $res[$a] = $a;
} }