mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 06:34:41 +01:00
Add 'video' boolean to phone call storage (#1077)
* Update UpdateHandler.php Instead passing empty array as reason pass `['_' => 'phoneCallDiscardReasonDisconnect']` in case the reason is not present By according documentation the reason is optional: https://core.telegram.org/constructor/phoneCallDiscarded * Update UpdateHandler.php * Add 'video' boolean to phone call storage Event handler should detect is incoming call video or voice * remove coment
This commit is contained in:
parent
cbb2819d6d
commit
a6a9aeb60b
@ -316,6 +316,7 @@ trait UpdateHandler
|
||||
$controller = new \danog\MadelineProto\VoIP(false, $update['phone_call']['admin_id'], $this, \danog\MadelineProto\VoIP::CALL_STATE_INCOMING);
|
||||
$controller->setCall($update['phone_call']);
|
||||
$controller->storage = ['g_a_hash' => $update['phone_call']['g_a_hash']];
|
||||
$controller->storage['video'] = $update['phone_call']['video'] ?? false;
|
||||
$update['phone_call'] = $this->calls[$update['phone_call']['id']] = $controller;
|
||||
break;
|
||||
case 'phoneCallAccepted':
|
||||
@ -334,7 +335,7 @@ trait UpdateHandler
|
||||
if (!isset($this->calls[$update['phone_call']['id']])) {
|
||||
return;
|
||||
}
|
||||
return $this->calls[$update['phone_call']['id']]->discard($update['phone_call']['reason'] ?? [], [], $update['phone_call']['need_debug'] ?? false);
|
||||
return $this->calls[$update['phone_call']['id']]->discard($update['phone_call']['reason'] ?? ['_' => 'phoneCallDiscardReasonDisconnect'], [], $update['phone_call']['need_debug'] ?? false);
|
||||
}
|
||||
}
|
||||
if ($update['_'] === 'updateNewEncryptedMessage' && !isset($update['message']['decrypted_message'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user