Final fixes

This commit is contained in:
Daniil Gentili 2017-07-31 18:57:13 +00:00
parent 40b99a3f24
commit 33427698f2
3 changed files with 6 additions and 8 deletions

View File

@ -111,7 +111,7 @@ class Logger
throw new \danog\MadelineProto\Exception(hex2bin('506c656173652075706461746520746f20746865206c61746573742076657273696f6e206f66204d6164656c696e6550726f746f2e'), 0, null, 'MadelineProto', 1);
}
if (class_exists('\danog\MadelineProto\VoIP')) {
if (!defined('\danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION') || \danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION !== '1.1') {
if (!defined('\danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION') || \danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION !== '1.1.1') {
throw new \danog\MadelineProto\Exception(hex2bin('506c6561736520757064617465207068702d6c69627467766f6970'), 0, null, 'MadelineProto', 1);
}
try {

View File

@ -44,7 +44,7 @@ class MTProto extends \Volatile
use \danog\MadelineProto\Wrappers\DialogHandler;
use \danog\MadelineProto\Wrappers\Login;
const V = 67;
const V = 68;
const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1;

View File

@ -150,11 +150,11 @@ trait AuthKeyHandler
'endpoints' => array_merge([$res['connection']], $res['alternative_connections']),
], $this->calls[$params['id']]->configuration);
$this->calls[$params['id']]->parseConfig();
$this->calls[$params['id']]->startTheMagic();
$res = $this->calls[$params['id']]->startTheMagic();
$this->handle_pending_updates();
return true;
return $res;
}
public function complete_call($params)
@ -168,7 +168,7 @@ trait AuthKeyHandler
$controller->discard();
}
});
if ($this->call_status($params['id']) !== \danog\MadelineProto\VoIP::CALL_STATE_ACCEPTED) {
if ($this->call_status($params['id']) !== \danog\MadelineProto\VoIP::CALL_STATE_ACCEPTED || !isset($this->calls[$params['id']]->storage['b'])) {
\danog\MadelineProto\Logger::log(['Could not find and complete call '.$params['id']]);
return false;
@ -212,9 +212,7 @@ trait AuthKeyHandler
'endpoints' => array_merge([$params['connection']], $params['alternative_connections']),
], $this->calls[$params['id']]->configuration);
$this->calls[$params['id']]->parseConfig();
$this->calls[$params['id']]->startTheMagic();
return true;
return $this->calls[$params['id']]->startTheMagic();
}
public function call_status($id)