diff --git a/docs/API_docs/types/PhoneCall.md b/docs/API_docs/types/PhoneCall.md index 5f578bf1..668c475e 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 5f578bf1..668c475e 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 5f578bf1..668c475e 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 5f578bf1..668c475e 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 5f578bf1..668c475e 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 42642572..06b892de 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 02b21f6a..9ab9e080 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(); }