This commit is contained in:
Daniil Gentili 2017-07-19 23:43:16 +02:00
parent d278293589
commit af1df14fc3
3 changed files with 20 additions and 13 deletions

View File

@ -80,7 +80,12 @@ class Lua
if (is_callable($cb)) { if (is_callable($cb)) {
$cb($result, $cb_extra); $cb($result, $cb_extra);
} }
array_walk_recursive($result, function (&$value, $key) { if ($value instanceof \danog\MadelineProto\TL\Types\Button) $value = $value->jsonSerialize(); }); array_walk_recursive($result, function (&$value, $key) {
if ($value instanceof \danog\MadelineProto\TL\Types\Button) {
$value = $value->jsonSerialize();
}
});
return $result; return $result;
} }

View File

@ -456,7 +456,7 @@ trait UpdateHandler
switch ($update['phone_call']['_']) { switch ($update['phone_call']['_']) {
case 'phoneCallRequested': case 'phoneCallRequested':
return $this->accept_call($update['phone_call']); return $this->accept_call($update['phone_call']);
case 'phoneCallAccepted': case 'phoneCallAccepted':
$this->confirm_call($update['phone_call']); $this->confirm_call($update['phone_call']);

View File

@ -48,6 +48,7 @@ trait AuthKeyHandler
$this->handle_pending_updates(); $this->handle_pending_updates();
$this->get_updates_difference(); $this->get_updates_difference();
return $controller; return $controller;
} }
@ -99,19 +100,19 @@ trait AuthKeyHandler
$this->calls[$params['id']]->configuration = array_merge([ $this->calls[$params['id']]->configuration = array_merge([
'config' => [ 'config' => [
'recv_timeout' => $this->config['call_receive_timeout_ms'] / 1000, 'recv_timeout' => $this->config['call_receive_timeout_ms'] / 1000,
'init_timeout' => $this->config['call_connect_timeout_ms'] / 1000, 'init_timeout' => $this->config['call_connect_timeout_ms'] / 1000,
'data_saving' => \danog\MadelineProto\VoIP::DATA_SAVING_NEVER, 'data_saving' => \danog\MadelineProto\VoIP::DATA_SAVING_NEVER,
'enable_NS' => true, 'enable_NS' => true,
'enable_AEC' => true, 'enable_AEC' => true,
'enable_AGC' => true, 'enable_AGC' => true,
'log_file_path' => $this->settings['calls']['log_file_path'], 'log_file_path' => $this->settings['calls']['log_file_path'],
'stats_dump_file_path' => $this->settings['calls']['stats_dump_file_path'] 'stats_dump_file_path' => $this->settings['calls']['stats_dump_file_path'],
], ],
'auth_key' => $key['auth_key'], 'auth_key' => $key['auth_key'],
'network_type' => $this->settings['calls']['network_type'], 'network_type' => $this->settings['calls']['network_type'],
'shared_config' => $this->method_call('phone.getCallConfig', [], ['datacenter' => $this->datacenter->curdc]), 'shared_config' => $this->method_call('phone.getCallConfig', [], ['datacenter' => $this->datacenter->curdc]),
'endpoints' => array_merge([$res['connection']], $res['alternative_connections']), 'endpoints' => array_merge([$res['connection']], $res['alternative_connections']),
], $this->calls[$params['id']]->configuration); ], $this->calls[$params['id']]->configuration);
$this->calls[$params['id']]->parseConfig(); $this->calls[$params['id']]->parseConfig();
$this->calls[$params['id']]->startTheMagic(); $this->calls[$params['id']]->startTheMagic();
@ -190,6 +191,7 @@ trait AuthKeyHandler
$controller->discard(); $controller->discard();
} }
} }
return $this->calls[$call]; return $this->calls[$call];
} }