diff --git a/docs/API_docs/types/PhoneCall.md b/docs/API_docs/types/PhoneCall.md index 5f578bf1f..668c475e2 100644 --- a/docs/API_docs/types/PhoneCall.md +++ b/docs/API_docs/types/PhoneCall.md @@ -80,7 +80,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/old_docs/API_docs_v62/types/PhoneCall.md b/old_docs/API_docs_v62/types/PhoneCall.md index 5f578bf1f..668c475e2 100644 --- a/old_docs/API_docs_v62/types/PhoneCall.md +++ b/old_docs/API_docs_v62/types/PhoneCall.md @@ -80,7 +80,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/old_docs/API_docs_v65/types/PhoneCall.md b/old_docs/API_docs_v65/types/PhoneCall.md index 5f578bf1f..668c475e2 100644 --- a/old_docs/API_docs_v65/types/PhoneCall.md +++ b/old_docs/API_docs_v65/types/PhoneCall.md @@ -80,7 +80,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/old_docs/API_docs_v66/types/PhoneCall.md b/old_docs/API_docs_v66/types/PhoneCall.md index 5f578bf1f..668c475e2 100644 --- a/old_docs/API_docs_v66/types/PhoneCall.md +++ b/old_docs/API_docs_v66/types/PhoneCall.md @@ -80,7 +80,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/old_docs/API_docs_v68/types/PhoneCall.md b/old_docs/API_docs_v68/types/PhoneCall.md index 5f578bf1f..668c475e2 100644 --- a/old_docs/API_docs_v68/types/PhoneCall.md +++ b/old_docs/API_docs_v68/types/PhoneCall.md @@ -80,7 +80,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/src/danog/MadelineProto/DocsBuilder.php b/src/danog/MadelineProto/DocsBuilder.php index 42642572c..06b892de1 100644 --- a/src/danog/MadelineProto/DocsBuilder.php +++ b/src/danog/MadelineProto/DocsBuilder.php @@ -751,7 +751,7 @@ Call states (these constants are incrementing integers, thus can be compared lik * `getState()` - Gets the controller state, as a VoIPController state constant * `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis +* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. * `getStats()` Gets connection stats * `getOtherID()` - Gets the id of the other call participant, as a bot API ID * `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://daniil.it/MadelineProto/API_docs/types/PhoneCallProtocol.html) object diff --git a/tests/testing.php b/tests/testing.php index 02b21f6a3..9ab9e0807 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -87,6 +87,10 @@ $m->import_authorization($MadelineProto->export_authorization()); */ if (stripos(readline('Do you want to make a call? (y/n): '), 'y') !== false) { $controller = $MadelineProto->request_call(getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw'); + while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) { + $MadelineProto->get_updates(); + } + var_dump($controller->getVisualization()); while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_ENDED) { $MadelineProto->get_updates(); }